github.com/matrixorigin/matrixone@v0.7.0/proto/metadata.proto (about) 1 /* 2 * Copyright 2021 Matrix Origin 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 syntax = "proto3"; 18 package metadata; 19 option go_package = "github.com/matrixorigin/matrixone/pkg/pb/metadata"; 20 21 import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 22 23 option (gogoproto.goproto_enum_prefix_all) = true; 24 25 // ServiceType service type 26 enum ServiceType { 27 // CN cn service 28 CN = 0; 29 // DN dn service 30 DN = 1; 31 // LOG log service 32 LOG = 2; 33 } 34 35 // DNShardRecord is DN shard metadata describing what is a DN shard. It 36 // is internally used by HAKeeper to maintain how many DNs available in 37 // the system. 38 message DNShardRecord { 39 // ShardID the id of the DN shard. 40 uint64 ShardID = 1; 41 // LogShardID a DN corresponds to a unique Shard of LogService. 42 uint64 LogShardID = 2; 43 } 44 45 // DNShard 46 message DNShard { 47 // DNShard extends DNShardRecord 48 DNShardRecord DNShardRecord = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; 49 // ReplicaID only one replica for one DN. The ReplicaID is specified at 50 // the time the DN is created. DN restart ReplicaID will not change, when 51 // a DN is migrated to another node, the ReplicaID will be reset. 52 uint64 ReplicaID = 2; 53 // Address is DN's external service address. 54 string Address = 3; 55 } 56 57 // LogShardRecord is Log Shard Metadata describing what is a Log shard. It is 58 // internally used by the HAKeeper to maintain how many Log shards are available 59 // in the system. 60 message LogShardRecord { 61 // ShardID is the id of the Log Shard. 62 uint64 ShardID = 1; 63 // NumberOfReplicas is the number of replicas in the shard. 64 uint64 NumberOfReplicas = 2; 65 } 66 67 // LogShard 68 message LogShard { 69 // LogShard extends LogShardRecord 70 LogShardRecord LogShardRecord = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; 71 // ReplicaID is the replica ID of the replica running on the LogStore. 72 uint64 ReplicaID = 2; 73 } 74 75 // DNStore DN store metadata 76 message DNStore { 77 // UUID DNStore uuid id 78 string UUID = 1; 79 // Shards DNShards 80 repeated DNShard Shards = 2 [(gogoproto.nullable) = false]; 81 } 82 83 // LogStore is for the metadata for Log store. 84 message LogStore { 85 // UUID is the id of the Log store. 86 string UUID = 1; 87 // Shards is for Log shards metadata. 88 repeated LogShard Shards = 2 [(gogoproto.nullable) = false]; 89 } 90 91 // CNRole cn node role 92 enum CNRole { 93 // TP tp node 94 TP = 0; 95 // AP ap node 96 AP = 1; 97 } 98 99 // CNStore cn store metadata 100 message CNStore { 101 // UUID CNStore uuid id 102 string UUID = 1; 103 // Role CN role 104 CNRole Role = 2; 105 }