/* * Copyright (C) 2017 Dgraph Labs, Inc. and Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ syntax = "proto3"; package pb; message KV { bytes key = 1; bytes value = 2; bytes user_meta = 3; uint64 version = 4; uint64 expires_at = 5; bytes meta = 6; // Stream id is used to identify which stream the KV came from. uint32 stream_id = 10; // Stream done is used to indicate end of stream. bool stream_done = 11; enum Kind { KEY = 0; DATA_KEY = 1; FILE = 2; } Kind kind = 12; } message KVList { repeated KV kv = 1; // alloc_ref used internally for memory management. uint64 alloc_ref = 10; } message ManifestChangeSet { // A set of changes that are applied atomically. repeated ManifestChange changes = 1; } enum EncryptionAlgorithm { None = 0; Aes = 1; } message Encryption { EncryptionAlgorithm algo = 1; // For storing type of encryption algorithm used bytes secret = 2; // For storing the secret key } message ManifestChange { uint64 id = 1; // Table ID. enum Operation { CREATE = 0; DELETE = 1; } Operation op = 2; uint32 level = 3; // Only used for CREATE. uint64 key_id = 4; EncryptionAlgorithm encryption_algo = 5; uint32 compression = 6; // Only used for CREATE Op. } // Compression specifies how a block should be compressed. message Compression { // CompressionAlgorithm specifies to use which algorithm to compress a block. enum CompressionAlgorithm { // None mode indicates that a block is not compressed. None = 0; // Snappy mode indicates that a block is compressed using Snappy algorithm. Snappy = 1; // ZSTD mode indicates that a block is compressed using ZSTD algorithm. // ZSTD, Zstd = 2; // Lz4 mode indicates that a block is compressed using lz4 algorithm. Lz4 = 3; } // compression algorithm CompressionAlgorithm algo = 1; // only for zstd, <= 0 use default(3) compression level, 1 - 21 uses the exact level of zstd compression level, >=22 use the largest compression level supported by zstd. int32 level = 2; } message Checksum { enum ChecksumAlgorithm { CRC32C = 0; XXHash64 = 1; SeaHash = 2; } ChecksumAlgorithm algo = 1; // For storing type of Checksum algorithm used uint64 sum = 2; } message DataKey { uint64 key_id = 1; bytes data = 2; bytes iv = 3; uint64 created_at = 4; } message Match { bytes prefix = 1; string ignore_bytes = 2; // Comma separated with dash to represent ranges "1, 2-3, 4-7, 9" } message BlockOffset { bytes key = 1; uint32 offset = 2; uint32 len = 3; } message TableIndex { repeated BlockOffset offsets = 1; bytes bloom_filter = 2; uint32 estimated_size = 3; uint64 max_version = 4; uint32 key_count = 5; uint32 uncompressed_size = 6; uint32 stale_data_size = 7; }