github.com/m3db/m3@v1.5.0/src/cluster/generated/proto/placementpb/placement.proto (about) 1 // Copyright (c) 2017 Uber Technologies, Inc. 2 // 3 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // of this software and associated documentation files (the "Software"), to deal 5 // in the Software without restriction, including without limitation the rights 6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 // copies of the Software, and to permit persons to whom the Software is 8 // furnished to do so, subject to the following conditions: 9 // 10 // The above copyright notice and this permission notice shall be included in 11 // all copies or substantial portions of the Software. 12 // 13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 // THE SOFTWARE. 20 syntax = "proto3"; 21 22 package placementpb; 23 24 import "google/protobuf/wrappers.proto"; 25 26 message Placement { 27 map<string, Instance> instances = 1; 28 uint32 replica_factor = 2; 29 uint32 num_shards = 3; 30 bool is_sharded = 4; 31 32 // cutover_time is the placement-level cutover time and determines when the clients 33 // watching the placement deems the placement as "in effect" and can use it to determine 34 // shard placement. 35 int64 cutover_time = 5; 36 37 bool is_mirrored = 6; 38 39 // max_shard_set_id stores the maximum shard set id used to guarantee unique 40 // shard set id generations across placement changes. 41 uint32 max_shard_set_id = 7; 42 } 43 44 message Instance { 45 string id = 1; 46 string isolation_group = 2; 47 string zone = 3; 48 uint32 weight = 4; 49 string endpoint = 5; 50 repeated Shard shards = 6; 51 uint32 shard_set_id = 7; 52 string hostname = 8; 53 uint32 port = 9; 54 InstanceMetadata metadata = 10; 55 } 56 57 message InstanceMetadata { 58 uint32 debug_port = 1; 59 } 60 61 message Shard { 62 uint32 id = 1; 63 ShardState state = 2; 64 string source_id = 3; 65 66 // Shard-level cutover and cutoff times determine when the shards have been cut over or 67 // cut off from the source instance to the destination instance. The placement-level 68 // cutover times are usually (but not required to be) earlier than shard-level cutover 69 // times if the clients watching the placement need to send traffic to the shards before 70 // they are ready to cut over or after they are ready to cut off (e.g., for warmup purposes). 71 int64 cutover_nanos = 4; 72 int64 cutoff_nanos = 5; 73 74 // redirect_to_shard_id is used during resharding process. 75 // If set, all the incoming writes will be redirected to the specified shard. 76 google.protobuf.UInt32Value redirect_to_shard_id = 6; 77 } 78 79 enum ShardState { 80 INITIALIZING = 0; 81 AVAILABLE = 1; 82 LEAVING = 2; 83 } 84 85 enum CompressMode { 86 NONE = 0; 87 ZSTD = 1; 88 } 89 90 message PlacementSnapshots { 91 // snapshots field is used only when compress_mode == NONE. 92 repeated Placement snapshots = 1 [deprecated = true]; 93 CompressMode compress_mode = 2; 94 bytes compressed_placement = 3; 95 } 96 97 message Options { 98 google.protobuf.BoolValue is_sharded = 1; 99 google.protobuf.BoolValue skip_port_mirroring = 2; 100 // TODO: cover all the fields in src/cluster/placement/config.go 101 }