// Copyright 2023 Greptime Team // // 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 greptime.v1.meta; option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1/meta"; import "greptime/v1/meta/common.proto"; service Router { // Fetch routing information for tables. The smallest unit is the complete // routing information(all regions) of a table. // // ```text // table_1 // table_name // table_schema // regions // region_1 // leader_peer // follower_peer_1, follower_peer_2 // region_2 // leader_peer // follower_peer_1, follower_peer_2, follower_peer_3 // region_xxx // table_2 // ... // ``` // rpc Route(RouteRequest) returns (RouteResponse) {} } message RouteRequest { RequestHeader header = 1; repeated TableId table_ids = 2; } message RouteResponse { ResponseHeader header = 1; repeated Peer peers = 2; repeated TableRoute table_routes = 3; } message TableRoute { Table table = 1; repeated RegionRoute region_routes = 2; } message RegionRoute { Region region = 1; // single leader node for write task uint64 leader_peer_index = 2; // multiple follower nodes for read task repeated uint64 follower_peer_indexes = 3; } message Table { uint64 id = 1; TableName table_name = 2; bytes table_schema = 3; } message Region { // TODO(LFC): Maybe use message RegionNumber? uint64 id = 1; string name = 2; Partition partition = 3; map attrs = 100; } // PARTITION `region_name` VALUES LESS THAN (value_list) message Partition { repeated bytes column_list = 1; repeated bytes value_list = 2; } // This message is only for saving into store. message TableRouteValue { repeated Peer peers = 1; TableRoute table_route = 2; }