github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/storage/enginepb/file_registry.proto (about)

     1  // Copyright 2017 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  syntax = "proto3";
    12  package cockroach.storage.enginepb;
    13  option go_package = "enginepb";
    14  
    15  import "gogoproto/gogo.proto";
    16  
    17  enum RegistryVersion {
    18    // The only version so far.
    19    Base = 0;
    20  }
    21  
    22  // EnvType determines which rocksdb::Env is used and for what purpose.
    23  enum EnvType {
    24    // The default Env when no encryption is used.
    25    // File using Plaintext are not recorded in the file registry.
    26    Plaintext = 0;
    27    // The Env using store-level keys.
    28    // Used only to read/write the data key registry.
    29    Store = 1;
    30    // The Env using data-level keys.
    31    // Used as the default rocksdb Env when encryption is enabled.
    32    Data = 2;
    33  }
    34  
    35  // Registry describes how a files are handled. This includes the
    36  // rockdb::Env responsible for each file as well as opaque env details.
    37  message FileRegistry {
    38    // version is currently always Base.
    39    RegistryVersion version = 1;
    40    // Map of filename -> FileEntry.
    41    // Filename is relative to the rocksdb dir if the file is inside it.
    42    // Otherwise it is an absolute path.
    43    // TODO(mberhault): figure out if we need anything special for Windows.
    44    map<string, FileEntry> files = 2;
    45  }
    46  
    47  message FileEntry {
    48    // Env type identifies which rocksdb::Env is responsible for this file.
    49    EnvType env_type = 1;
    50  
    51    // Env-specific fields for non-0 env. These are known by CCL code only.
    52    // This is a serialized protobuf. We cannot use protobuf.Any since we use
    53    // MessageLite in C++.
    54    bytes encryption_settings = 2;
    55  }