diff --git a/.gitignore b/.gitignore index a5533b2b9..02bc408e8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ spqr-worldmock spqr-balancer spqr-mover spqr-workloadreplay +spqrdump y.output *.swp *.swo diff --git a/Makefile b/Makefile index c166385e0..dd3282acc 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,10 @@ build_worldmock: build_workloadreplay: go build -pgo=auto -o spqr-workloadreplay ./cmd/workloadreplay -build: build_balancer build_coordinator build_coorctl build_router build_mover build_worldmock build_workloadreplay +build_spqrdump: + go build -pgo=auto -o spqrdump ./cmd/spqrdump + +build: build_balancer build_coordinator build_coorctl build_router build_mover build_worldmock build_workloadreplay build_spqrdump build_images: docker compose build spqr-base-image diff --git a/cmd/spqrdump/main.go b/cmd/spqrdump/main.go index de85c2eb5..eeae17659 100644 --- a/cmd/spqrdump/main.go +++ b/cmd/spqrdump/main.go @@ -5,6 +5,7 @@ import ( "crypto/tls" "fmt" "net" + "strings" "github.com/jackc/pgx/v5/pgproto3" "github.com/spf13/cobra" @@ -24,7 +25,7 @@ func Dial(addr string) (*grpc.ClientConn, error) { } var rootCmd = &cobra.Command{ - Use: "coorctl -e localhost:7003", + Use: "spqrdump -e localhost:7003", CompletionOptions: cobra.CompletionOptions{ DisableDefaultCmd: true, }, @@ -35,27 +36,7 @@ var rootCmd = &cobra.Command{ var endpoint string var proto string var passwd string - -// TODO : unit tests -func DumpRules() error { - cc, err := Dial(endpoint) - if err != nil { - return err - } - - rCl := protos.NewShardingRulesServiceClient(cc) - if rules, err := rCl.ListShardingRules(context.Background(), &protos.ListShardingRuleRequest{}); err != nil { - spqrlog.Zero.Error(). - Err(err). - Msg("failed to dump endpoint rules") - } else { - for _, rule := range rules.Rules { - fmt.Printf("%s;\n", decode.DecodeRule(rule)) - } - } - - return nil -} +var logLevel string // TODO : unit tests func waitRFQ(fr *pgproto3.Frontend) error { @@ -133,14 +114,27 @@ func getconn() (*pgproto3.Frontend, error) { } // TODO : unit tests -func DumpRulesPSQL() error { +func DumpKeyRangesPsql() error { + return dumpPsql("SHOW key_ranges;", func(v *pgproto3.DataRow) (string, error) { + l := string(v.Values[2]) + r := string(v.Values[3]) + id := string(v.Values[0]) + shard := string(v.Values[1]) + + return decode.KeyRange( + &protos.KeyRangeInfo{ + KeyRange: &protos.KeyRange{LowerBound: l, UpperBound: r}, + ShardId: shard, Krid: id}), nil + }) +} +func dumpPsql(query string, rowToStr func(v *pgproto3.DataRow) (string, error)) error { frontend, err := getconn() if err != nil { return err } frontend.Send(&pgproto3.Query{ - String: "SHOW key_ranges;", + String: query, }) if err := frontend.Flush(); err != nil { return err @@ -156,16 +150,11 @@ func DumpRulesPSQL() error { switch v := msg.(type) { case *pgproto3.DataRow: - l := string(v.Values[2]) - r := string(v.Values[3]) - id := string(v.Values[0]) - shard := string(v.Values[1]) - - fmt.Printf("%s;\n", - decode.DecodeKeyRange( - &protos.KeyRangeInfo{ - KeyRange: &protos.KeyRange{LowerBound: l, UpperBound: r}, - ShardId: shard, Krid: id})) + s, err := rowToStr(v) + if err != nil { + return err + } + fmt.Println(s) case *pgproto3.ErrorResponse: return fmt.Errorf("failed to wait for RQF: %s", v.Message) case *pgproto3.ReadyForQuery: @@ -176,85 +165,107 @@ func DumpRulesPSQL() error { } // TODO : unit tests -func DumpKeyRangesPSQL() error { - - frontend, err := getconn() +func DumpKeyRanges() error { + cc, err := Dial(endpoint) if err != nil { return err } - frontend.Send(&pgproto3.Query{ - String: "SHOW sharding_rules;", - }) - if err := frontend.Flush(); err != nil { - return err - } - for { - if msg, err := frontend.Receive(); err != nil { - return err - } else { - spqrlog.Zero.Debug(). - Interface("message", msg). - Msg("received message") - switch v := msg.(type) { - case *pgproto3.DataRow: - col := string(v.Values[2]) - id := string(v.Values[0]) - tablename := string(v.Values[1]) - - fmt.Printf("%s;\n", - decode.DecodeRule( - &protos.ShardingRule{ - Id: id, - TableName: tablename, - ShardingRuleEntry: []*protos.ShardingRuleEntry{ - { - Column: col, - }, - }, - }), - ) - case *pgproto3.ErrorResponse: - return fmt.Errorf("failed to wait for RQF: %s", v.Message) - case *pgproto3.ReadyForQuery: - return nil - } + rCl := protos.NewKeyRangeServiceClient(cc) + if keys, err := rCl.ListAllKeyRanges(context.Background(), &protos.ListAllKeyRangesRequest{}); err != nil { + spqrlog.Zero.Error(). + Err(err). + Msg("failed to dump endpoint rules") + } else { + for _, krg := range keys.KeyRangesInfo { + fmt.Println(decode.KeyRange(krg)) } } + + return nil } +// DumpDistributions dump info about distributions & attached relations via GRPC // TODO : unit tests -func DumpKeyRanges() error { +func DumpDistributions() error { cc, err := Dial(endpoint) if err != nil { return err } - rCl := protos.NewKeyRangeServiceClient(cc) - if keys, err := rCl.ListKeyRange(context.Background(), &protos.ListKeyRangeRequest{}); err != nil { + rCl := protos.NewDistributionServiceClient(cc) + if dss, err := rCl.ListDistributions(context.Background(), &protos.ListDistributionsRequest{}); err != nil { spqrlog.Zero.Error(). Err(err). - Msg("failed to dump endpoint rules") + Msg("failed to dump endpoint distributions") } else { - for _, krg := range keys.KeyRangesInfo { - fmt.Printf("%s;\n", decode.DecodeKeyRange(krg)) + for _, ds := range dss.Distributions { + fmt.Println(decode.Distribution(ds)) + for _, rel := range ds.Relations { + fmt.Println(decode.DistributedRelation(rel, ds.Id)) + } } } return nil } +// DumpDistributionsPsql dump info about distributions via psql +// TODO : unit tests +func DumpDistributionsPsql() error { + return dumpPsql("SHOW distributions;", func(v *pgproto3.DataRow) (string, error) { + id := string(v.Values[0]) + types := string(v.Values[1]) + + return decode.Distribution( + &protos.Distribution{ + Id: id, + ColumnTypes: strings.Split(types, ","), + }), nil + }) +} + +// DumpRelationsPsql dump info about distributed relations via psql +// TODO : unit tests +func DumpRelationsPsql() error { + return dumpPsql("SHOW relations;", func(v *pgproto3.DataRow) (string, error) { + name := string(v.Values[0]) + ds := string(v.Values[1]) + dsKeyStr := strings.Split(string(v.Values[2]), ",") + dsKey := make([]*protos.DistributionKeyEntry, len(dsKeyStr)) + for i, elem := range dsKeyStr { + elems := strings.Split(strings.Trim(elem, "()"), ",") + if len(elems) != 2 { + return "", fmt.Errorf("incorrect distribution key entry: \"%s\"", elem) + } + dsKey[i] = &protos.DistributionKeyEntry{ + Column: strings.Trim(elems[0], "\""), + HashFunction: elems[1], + } + } + + return decode.DistributedRelation( + &protos.DistributedRelation{ + Name: name, + DistributionKey: dsKey, + }, ds), nil + }) +} + var dump = &cobra.Command{ Use: "dump", - Short: "list running routers in current topology", + Short: "dump current sharding configuration", RunE: func(cmd *cobra.Command, args []string) error { + if err := spqrlog.UpdateZeroLogLevel(logLevel); err != nil { + return err + } spqrlog.Zero.Debug(). Str("endpoint", endpoint). Msg("dialing spqrdump on") switch proto { case "grpc": - if err := DumpRules(); err != nil { + if err := DumpDistributions(); err != nil { return err } if err := DumpKeyRanges(); err != nil { @@ -262,10 +273,13 @@ var dump = &cobra.Command{ } return nil case "psql": - if err := DumpRulesPSQL(); err != nil { + if err := DumpDistributionsPsql(); err != nil { + return err + } + if err := DumpRelationsPsql(); err != nil { return err } - if err := DumpKeyRangesPSQL(); err != nil { + if err := DumpKeyRangesPsql(); err != nil { return err } return nil @@ -278,12 +292,14 @@ var dump = &cobra.Command{ } func init() { - rootCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "localhost:7003", "endpoint for dump metadata") + rootCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "localhost:7000", "endpoint for dump metadata") rootCmd.PersistentFlags().StringVarP(&proto, "proto", "t", "grpc", "protocol to use for communication") rootCmd.PersistentFlags().StringVarP(&passwd, "passwd", "p", "", "password to use for communication") + rootCmd.PersistentFlags().StringVarP(&logLevel, "log-level", "l", "error", "log level") + rootCmd.AddCommand(dump) } diff --git a/coordinator/provider/keyranges.go b/coordinator/provider/keyranges.go index 10e6e81a7..acabb38b5 100644 --- a/coordinator/provider/keyranges.go +++ b/coordinator/provider/keyranges.go @@ -67,7 +67,7 @@ func (c *CoordinatorService) SplitKeyRange(ctx context.Context, request *protos. // TODO : unit tests func (c *CoordinatorService) ListKeyRange(ctx context.Context, request *protos.ListKeyRangeRequest) (*protos.KeyRangeReply, error) { - krsqb, err := c.impl.ListAllKeyRanges(ctx) + krsqb, err := c.impl.ListKeyRanges(ctx, request.Distribution) if err != nil { return nil, err } @@ -83,6 +83,21 @@ func (c *CoordinatorService) ListKeyRange(ctx context.Context, request *protos.L }, nil } +func (c *CoordinatorService) ListAllKeyRanges(ctx context.Context, _ *protos.ListAllKeyRangesRequest) (*protos.KeyRangeReply, error) { + krsDb, err := c.impl.ListAllKeyRanges(ctx) + if err != nil { + return nil, err + } + + krs := make([]*protos.KeyRangeInfo, len(krsDb)) + + for i, krg := range krsDb { + krs[i] = krg.ToProto() + } + + return &protos.KeyRangeReply{KeyRangesInfo: krs}, nil +} + // TODO : unit tests func (c *CoordinatorService) MoveKeyRange(ctx context.Context, request *protos.MoveKeyRangeRequest) (*protos.ModifyReply, error) { if err := c.impl.Move(ctx, &kr.MoveKeyRange{ diff --git a/pkg/coord/adapter.go b/pkg/coord/adapter.go index b5f09b197..48e907c68 100644 --- a/pkg/coord/adapter.go +++ b/pkg/coord/adapter.go @@ -59,7 +59,7 @@ func (a *Adapter) ListKeyRanges(ctx context.Context, distribution string) ([]*kr // TODO : unit tests func (a *Adapter) ListAllKeyRanges(ctx context.Context) ([]*kr.KeyRange, error) { c := proto.NewKeyRangeServiceClient(a.conn) - reply, err := c.ListKeyRange(ctx, &proto.ListKeyRangeRequest{}) + reply, err := c.ListAllKeyRanges(ctx, &proto.ListAllKeyRangesRequest{}) if err != nil { return nil, err } diff --git a/pkg/decode/spqrql.go b/pkg/decode/spqrql.go index d37c27220..3e7fe920e 100644 --- a/pkg/decode/spqrql.go +++ b/pkg/decode/spqrql.go @@ -2,22 +2,32 @@ package decode import ( "fmt" + "strings" protos "github.com/pg-sharding/spqr/pkg/protos" ) -// TODO : unit tests -func DecodeRule(rule *protos.ShardingRule) string { +// KeyRange returns query to create given key range +func KeyRange(krg *protos.KeyRangeInfo) string { /* TODO: composite key support */ - if rule.TableName != "" { - return fmt.Sprintf("CREATE SHARDING RULE %s TABLE %s COLUMN %s", rule.Id, rule.TableName, rule.ShardingRuleEntry[0].Column) - } - return fmt.Sprintf("CREATE SHARDING RULE %s COLUMN %s", rule.Id, rule.ShardingRuleEntry[0].Column) + return fmt.Sprintf("CREATE KEY RANGE %s FROM %s ROUTE TO %s FOR DISTRIBUTION %s;", krg.Krid, krg.KeyRange.LowerBound, krg.ShardId, krg.DistributionId) } -// TODO : unit tests -func DecodeKeyRange(krg *protos.KeyRangeInfo) string { - /* TODO: composite key support */ +// Distribution returns query to create given distribution +func Distribution(ds *protos.Distribution) string { + return fmt.Sprintf("CREATE DISTRIBUTION %s COLUMN TYPES %s;", ds.Id, strings.Join(ds.ColumnTypes, ", ")) +} - return fmt.Sprintf("CREATE KEY RANGE %s FROM %s TO %s ROUTE TO %s", krg.Krid, krg.KeyRange.LowerBound, krg.KeyRange.UpperBound, krg.ShardId) +// DistributedRelation return query to attach relation to distribution +func DistributedRelation(rel *protos.DistributedRelation, ds string) string { + elems := make([]string, len(rel.DistributionKey)) + for j, el := range rel.DistributionKey { + if el.HashFunction != "" { + elems[j] = fmt.Sprintf("%s HASH FUNCTION %s", el.Column, el.HashFunction) + } else { + elems[j] = el.Column + } + + } + return fmt.Sprintf("ALTER DISTRIBUTION %s ATTACH RELATION %s DISTRIBUTION KEY %s;", ds, rel.Name, strings.Join(elems, ", ")) } diff --git a/pkg/decode/spqrql_test.go b/pkg/decode/spqrql_test.go new file mode 100644 index 000000000..55b94a126 --- /dev/null +++ b/pkg/decode/spqrql_test.go @@ -0,0 +1,94 @@ +package decode + +import ( + protos "github.com/pg-sharding/spqr/pkg/protos" + "github.com/stretchr/testify/assert" + "testing" +) + +func TestKeyRange(t *testing.T) { + assert := assert.New(t) + assert.Equal("CREATE KEY RANGE kr1 FROM 10 ROUTE TO sh1 FOR DISTRIBUTION ds1;", + KeyRange(&protos.KeyRangeInfo{ + Krid: "kr1", + ShardId: "sh1", + DistributionId: "ds1", + KeyRange: &protos.KeyRange{ + LowerBound: "10", + }, + })) + // UpperBound is ignored + assert.Equal("CREATE KEY RANGE kr1 FROM 10 ROUTE TO sh1 FOR DISTRIBUTION ds1;", + KeyRange(&protos.KeyRangeInfo{ + Krid: "kr1", + ShardId: "sh1", + DistributionId: "ds1", + KeyRange: &protos.KeyRange{ + LowerBound: "10", + UpperBound: "20", + }, + })) +} + +func TestDistribution(t *testing.T) { + assert := assert.New(t) + assert.Equal("CREATE DISTRIBUTION ds1 COLUMN TYPES integer;", + Distribution(&protos.Distribution{ + Id: "ds1", + ColumnTypes: []string{"integer"}, + })) + + // relations ignored + assert.Equal("CREATE DISTRIBUTION ds1 COLUMN TYPES integer;", + Distribution(&protos.Distribution{ + Id: "ds1", + ColumnTypes: []string{"integer"}, + Relations: []*protos.DistributedRelation{ + {Name: "rel", DistributionKey: []*protos.DistributionKeyEntry{{Column: "id", HashFunction: "identity"}}}, + }, + })) + + // multiple types + assert.Equal("CREATE DISTRIBUTION ds1 COLUMN TYPES integer, varchar;", + Distribution(&protos.Distribution{ + Id: "ds1", + ColumnTypes: []string{"integer", "varchar"}, + })) + + // order is preserved + assert.Equal("CREATE DISTRIBUTION ds1 COLUMN TYPES varchar, integer;", + Distribution(&protos.Distribution{ + Id: "ds1", + ColumnTypes: []string{"varchar", "integer"}, + })) +} + +func TestDistributedRelation(t *testing.T) { + assert := assert.New(t) + assert.Equal("ALTER DISTRIBUTION ds1 ATTACH RELATION rel DISTRIBUTION KEY id HASH FUNCTION identity;", + DistributedRelation(&protos.DistributedRelation{ + Name: "rel", + DistributionKey: []*protos.DistributionKeyEntry{{Column: "id", HashFunction: "identity"}}, + }, "ds1"), + ) + + // missing hash func + assert.Equal("ALTER DISTRIBUTION ds1 ATTACH RELATION rel DISTRIBUTION KEY id;", + DistributedRelation(&protos.DistributedRelation{ + Name: "rel", + DistributionKey: []*protos.DistributionKeyEntry{{Column: "id"}}, + }, "ds1"), + ) + + // multiple columns + assert.Equal("ALTER DISTRIBUTION ds1 ATTACH RELATION rel DISTRIBUTION KEY id HASH FUNCTION identity, "+ + "id2 HASH FUNCTION city;", + DistributedRelation(&protos.DistributedRelation{ + Name: "rel", + DistributionKey: []*protos.DistributionKeyEntry{ + {Column: "id", HashFunction: "identity"}, + {Column: "id2", HashFunction: "city"}, + }, + }, "ds1"), + ) +} diff --git a/pkg/models/distributions/distribution.go b/pkg/models/distributions/distribution.go index e72ecfc17..37b2648a9 100644 --- a/pkg/models/distributions/distribution.go +++ b/pkg/models/distributions/distribution.go @@ -123,7 +123,15 @@ func DistributionFromDB(distr *qdb.Distribution) *Distribution { func DistributionFromProto(ds *proto.Distribution) *Distribution { return &Distribution{ - Id: ds.Id, + Id: ds.Id, + ColTypes: ds.ColumnTypes, + Relations: func() map[string]*DistributedRelation { + res := make(map[string]*DistributedRelation) + for _, rel := range ds.Relations { + res[rel.Name] = DistributedRelationFromProto(rel) + } + return res + }(), } } diff --git a/pkg/protos/key_range.pb.go b/pkg/protos/key_range.pb.go index f89f5fa52..e75609dd4 100644 --- a/pkg/protos/key_range.pb.go +++ b/pkg/protos/key_range.pb.go @@ -240,6 +240,44 @@ func (x *ListKeyRangeRequest) GetDistribution() string { return "" } +type ListAllKeyRangesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListAllKeyRangesRequest) Reset() { + *x = ListAllKeyRangesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_key_range_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAllKeyRangesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAllKeyRangesRequest) ProtoMessage() {} + +func (x *ListAllKeyRangesRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_key_range_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAllKeyRangesRequest.ProtoReflect.Descriptor instead. +func (*ListAllKeyRangesRequest) Descriptor() ([]byte, []int) { + return file_protos_key_range_proto_rawDescGZIP(), []int{3} +} + type AddKeyRangeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -251,7 +289,7 @@ type AddKeyRangeRequest struct { func (x *AddKeyRangeRequest) Reset() { *x = AddKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[3] + mi := &file_protos_key_range_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -264,7 +302,7 @@ func (x *AddKeyRangeRequest) String() string { func (*AddKeyRangeRequest) ProtoMessage() {} func (x *AddKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[3] + mi := &file_protos_key_range_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -277,7 +315,7 @@ func (x *AddKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddKeyRangeRequest.ProtoReflect.Descriptor instead. func (*AddKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{3} + return file_protos_key_range_proto_rawDescGZIP(), []int{4} } func (x *AddKeyRangeRequest) GetKeyRangeInfo() *KeyRangeInfo { @@ -300,7 +338,7 @@ type SplitKeyRangeRequest struct { func (x *SplitKeyRangeRequest) Reset() { *x = SplitKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[4] + mi := &file_protos_key_range_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -313,7 +351,7 @@ func (x *SplitKeyRangeRequest) String() string { func (*SplitKeyRangeRequest) ProtoMessage() {} func (x *SplitKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[4] + mi := &file_protos_key_range_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -326,7 +364,7 @@ func (x *SplitKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SplitKeyRangeRequest.ProtoReflect.Descriptor instead. func (*SplitKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{4} + return file_protos_key_range_proto_rawDescGZIP(), []int{5} } func (x *SplitKeyRangeRequest) GetKeyRangeInfo() *KeyRangeInfo { @@ -362,7 +400,7 @@ type MergeKeyRangeRequest struct { func (x *MergeKeyRangeRequest) Reset() { *x = MergeKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[5] + mi := &file_protos_key_range_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -375,7 +413,7 @@ func (x *MergeKeyRangeRequest) String() string { func (*MergeKeyRangeRequest) ProtoMessage() {} func (x *MergeKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[5] + mi := &file_protos_key_range_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -388,7 +426,7 @@ func (x *MergeKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MergeKeyRangeRequest.ProtoReflect.Descriptor instead. func (*MergeKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{5} + return file_protos_key_range_proto_rawDescGZIP(), []int{6} } func (x *MergeKeyRangeRequest) GetBound() []byte { @@ -417,7 +455,7 @@ type MoveKeyRangeRequest struct { func (x *MoveKeyRangeRequest) Reset() { *x = MoveKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[6] + mi := &file_protos_key_range_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -430,7 +468,7 @@ func (x *MoveKeyRangeRequest) String() string { func (*MoveKeyRangeRequest) ProtoMessage() {} func (x *MoveKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[6] + mi := &file_protos_key_range_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -443,7 +481,7 @@ func (x *MoveKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MoveKeyRangeRequest.ProtoReflect.Descriptor instead. func (*MoveKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{6} + return file_protos_key_range_proto_rawDescGZIP(), []int{7} } func (x *MoveKeyRangeRequest) GetKeyRange() *KeyRangeInfo { @@ -471,7 +509,7 @@ type DropKeyRangeRequest struct { func (x *DropKeyRangeRequest) Reset() { *x = DropKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[7] + mi := &file_protos_key_range_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -484,7 +522,7 @@ func (x *DropKeyRangeRequest) String() string { func (*DropKeyRangeRequest) ProtoMessage() {} func (x *DropKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[7] + mi := &file_protos_key_range_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -497,7 +535,7 @@ func (x *DropKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DropKeyRangeRequest.ProtoReflect.Descriptor instead. func (*DropKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{7} + return file_protos_key_range_proto_rawDescGZIP(), []int{8} } func (x *DropKeyRangeRequest) GetId() []string { @@ -516,7 +554,7 @@ type DropAllKeyRangesRequest struct { func (x *DropAllKeyRangesRequest) Reset() { *x = DropAllKeyRangesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[8] + mi := &file_protos_key_range_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -529,7 +567,7 @@ func (x *DropAllKeyRangesRequest) String() string { func (*DropAllKeyRangesRequest) ProtoMessage() {} func (x *DropAllKeyRangesRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[8] + mi := &file_protos_key_range_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -542,7 +580,7 @@ func (x *DropAllKeyRangesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DropAllKeyRangesRequest.ProtoReflect.Descriptor instead. func (*DropAllKeyRangesRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{8} + return file_protos_key_range_proto_rawDescGZIP(), []int{9} } type DropAllKeyRangesResponse struct { @@ -556,7 +594,7 @@ type DropAllKeyRangesResponse struct { func (x *DropAllKeyRangesResponse) Reset() { *x = DropAllKeyRangesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[9] + mi := &file_protos_key_range_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -569,7 +607,7 @@ func (x *DropAllKeyRangesResponse) String() string { func (*DropAllKeyRangesResponse) ProtoMessage() {} func (x *DropAllKeyRangesResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[9] + mi := &file_protos_key_range_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -582,7 +620,7 @@ func (x *DropAllKeyRangesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DropAllKeyRangesResponse.ProtoReflect.Descriptor instead. func (*DropAllKeyRangesResponse) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{9} + return file_protos_key_range_proto_rawDescGZIP(), []int{10} } func (x *DropAllKeyRangesResponse) GetKeyRange() []*KeyRangeInfo { @@ -603,7 +641,7 @@ type LockKeyRangeRequest struct { func (x *LockKeyRangeRequest) Reset() { *x = LockKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[10] + mi := &file_protos_key_range_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -616,7 +654,7 @@ func (x *LockKeyRangeRequest) String() string { func (*LockKeyRangeRequest) ProtoMessage() {} func (x *LockKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[10] + mi := &file_protos_key_range_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -629,7 +667,7 @@ func (x *LockKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LockKeyRangeRequest.ProtoReflect.Descriptor instead. func (*LockKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{10} + return file_protos_key_range_proto_rawDescGZIP(), []int{11} } func (x *LockKeyRangeRequest) GetId() []string { @@ -650,7 +688,7 @@ type UnlockKeyRangeRequest struct { func (x *UnlockKeyRangeRequest) Reset() { *x = UnlockKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[11] + mi := &file_protos_key_range_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -663,7 +701,7 @@ func (x *UnlockKeyRangeRequest) String() string { func (*UnlockKeyRangeRequest) ProtoMessage() {} func (x *UnlockKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[11] + mi := &file_protos_key_range_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -676,7 +714,7 @@ func (x *UnlockKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockKeyRangeRequest.ProtoReflect.Descriptor instead. func (*UnlockKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{11} + return file_protos_key_range_proto_rawDescGZIP(), []int{12} } func (x *UnlockKeyRangeRequest) GetId() []string { @@ -697,7 +735,7 @@ type KeyRangeReply struct { func (x *KeyRangeReply) Reset() { *x = KeyRangeReply{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[12] + mi := &file_protos_key_range_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -710,7 +748,7 @@ func (x *KeyRangeReply) String() string { func (*KeyRangeReply) ProtoMessage() {} func (x *KeyRangeReply) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[12] + mi := &file_protos_key_range_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -723,7 +761,7 @@ func (x *KeyRangeReply) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyRangeReply.ProtoReflect.Descriptor instead. func (*KeyRangeReply) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{12} + return file_protos_key_range_proto_rawDescGZIP(), []int{13} } func (x *KeyRangeReply) GetKeyRangesInfo() []*KeyRangeInfo { @@ -744,7 +782,7 @@ type ModifyReply struct { func (x *ModifyReply) Reset() { *x = ModifyReply{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[13] + mi := &file_protos_key_range_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -757,7 +795,7 @@ func (x *ModifyReply) String() string { func (*ModifyReply) ProtoMessage() {} func (x *ModifyReply) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[13] + mi := &file_protos_key_range_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -770,7 +808,7 @@ func (x *ModifyReply) ProtoReflect() protoreflect.Message { // Deprecated: Use ModifyReply.ProtoReflect.Descriptor instead. func (*ModifyReply) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{13} + return file_protos_key_range_proto_rawDescGZIP(), []int{14} } func (x *ModifyReply) GetOperationId() string { @@ -791,7 +829,7 @@ type ResolveKeyRangeRequest struct { func (x *ResolveKeyRangeRequest) Reset() { *x = ResolveKeyRangeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[14] + mi := &file_protos_key_range_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -804,7 +842,7 @@ func (x *ResolveKeyRangeRequest) String() string { func (*ResolveKeyRangeRequest) ProtoMessage() {} func (x *ResolveKeyRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[14] + mi := &file_protos_key_range_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -817,7 +855,7 @@ func (x *ResolveKeyRangeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveKeyRangeRequest.ProtoReflect.Descriptor instead. func (*ResolveKeyRangeRequest) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{14} + return file_protos_key_range_proto_rawDescGZIP(), []int{15} } func (x *ResolveKeyRangeRequest) GetBound() string { @@ -838,7 +876,7 @@ type ResolveKeyRangeReply struct { func (x *ResolveKeyRangeReply) Reset() { *x = ResolveKeyRangeReply{} if protoimpl.UnsafeEnabled { - mi := &file_protos_key_range_proto_msgTypes[15] + mi := &file_protos_key_range_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -851,7 +889,7 @@ func (x *ResolveKeyRangeReply) String() string { func (*ResolveKeyRangeReply) ProtoMessage() {} func (x *ResolveKeyRangeReply) ProtoReflect() protoreflect.Message { - mi := &file_protos_key_range_proto_msgTypes[15] + mi := &file_protos_key_range_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -864,7 +902,7 @@ func (x *ResolveKeyRangeReply) ProtoReflect() protoreflect.Message { // Deprecated: Use ResolveKeyRangeReply.ProtoReflect.Descriptor instead. func (*ResolveKeyRangeReply) Descriptor() ([]byte, []int) { - return file_protos_key_range_proto_rawDescGZIP(), []int{15} + return file_protos_key_range_proto_rawDescGZIP(), []int{16} } func (x *ResolveKeyRangeReply) GetKeyRangeD() []string { @@ -896,109 +934,115 @@ var file_protos_key_range_proto_rawDesc = []byte{ 0x22, 0x39, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, - 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4e, 0x0a, 0x12, 0x41, - 0x64, 0x64, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x38, 0x0a, 0x0e, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, - 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x6b, - 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x14, - 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0e, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, - 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0c, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, - 0x0a, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x64, 0x22, 0x50, 0x0a, 0x14, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, - 0x22, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x13, 0x4d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x09, 0x6b, 0x65, - 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x19, 0x0a, 0x17, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4e, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x4b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0e, + 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x14, 0x53, 0x70, 0x6c, 0x69, 0x74, + 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x38, 0x0a, 0x0e, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, + 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x6b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x22, 0x50, 0x0a, 0x14, + 0x4d, 0x65, 0x72, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, + 0x0a, 0x13, 0x4d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, + 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6b, 0x65, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x53, 0x68, 0x61, 0x72, + 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x53, 0x68, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x13, 0x44, 0x72, 0x6f, 0x70, 0x4b, 0x65, 0x79, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x44, + 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x18, 0x44, 0x72, 0x6f, 0x70, 0x41, 0x6c, + 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x22, 0x25, 0x0a, 0x13, 0x4c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x15, 0x55, 0x6e, + 0x6c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3a, 0x0a, 0x0f, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, - 0x6f, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x74, 0x6f, 0x53, 0x68, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x13, 0x44, 0x72, 0x6f, + 0x6f, 0x52, 0x0d, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, + 0x22, 0x30, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x22, 0x36, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1e, 0x0a, 0x0b, 0x6b, 0x65, + 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x09, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x2a, 0x2b, 0x0a, 0x0e, 0x4b, 0x65, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, + 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x56, 0x41, 0x49, + 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x32, 0x87, 0x06, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x4c, + 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x70, + 0x71, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x6c, 0x6c, + 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x13, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0c, 0x4c, 0x6f, 0x63, 0x6b, 0x4b, + 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4c, + 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x4b, 0x65, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x41, 0x64, + 0x64, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0c, 0x44, 0x72, 0x6f, 0x70, 0x4b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x19, 0x0a, 0x17, 0x44, 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4b, 0x0a, 0x18, 0x44, - 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x72, - 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, - 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, - 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x25, 0x0a, 0x13, 0x4c, 0x6f, 0x63, 0x6b, - 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x27, 0x0a, 0x15, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4b, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3a, 0x0a, 0x0f, 0x6b, 0x65, 0x79, - 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x30, 0x0a, 0x0b, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x2e, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x36, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x1e, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x64, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x2a, - 0x2b, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, - 0x09, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x32, 0xbd, 0x05, 0x0a, - 0x0f, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x40, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x19, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4b, 0x65, 0x79, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x73, 0x70, - 0x71, 0x72, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0c, 0x4c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, - 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, - 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x12, 0x18, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x41, 0x64, 0x64, 0x4b, 0x65, 0x79, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, - 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x12, 0x3e, 0x0a, 0x0c, 0x44, 0x72, 0x6f, 0x70, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x19, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x4b, 0x65, 0x79, 0x52, + 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x53, 0x0a, 0x10, 0x44, 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, + 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x70, 0x71, 0x72, + 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, + 0x44, 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0e, 0x55, 0x6e, + 0x6c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x2e, 0x73, + 0x70, 0x71, 0x72, 0x2e, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, + 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x40, + 0x0a, 0x0d, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x1a, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x12, 0x53, 0x0a, 0x10, 0x44, 0x72, 0x6f, 0x70, 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x44, 0x72, 0x6f, 0x70, - 0x41, 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x41, - 0x6c, 0x6c, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0e, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x4b, - 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x55, - 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, - 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, 0x53, 0x70, 0x6c, - 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x70, 0x71, - 0x72, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, - 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, 0x4d, - 0x65, 0x72, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1a, 0x2e, 0x73, - 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, - 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, - 0x0c, 0x4d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x19, 0x2e, - 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, - 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, - 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x1c, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4b, - 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, - 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4b, 0x65, 0x79, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x0c, 0x5a, 0x0a, - 0x73, 0x70, 0x71, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x12, 0x40, 0x0a, 0x0d, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x4b, 0x65, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, + 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0c, 0x4d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4b, 0x65, + 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, + 0x73, 0x70, 0x71, 0x72, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x4b, 0x65, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1c, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x6c, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x73, 0x70, 0x71, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x00, 0x42, 0x0c, 0x5a, 0x0a, 0x73, 0x70, 0x71, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1014,25 +1058,26 @@ func file_protos_key_range_proto_rawDescGZIP() []byte { } var file_protos_key_range_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_protos_key_range_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_protos_key_range_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_protos_key_range_proto_goTypes = []interface{}{ (KeyRangeStatus)(0), // 0: spqr.KeyRangeStatus (*KeyRange)(nil), // 1: spqr.KeyRange (*KeyRangeInfo)(nil), // 2: spqr.KeyRangeInfo (*ListKeyRangeRequest)(nil), // 3: spqr.ListKeyRangeRequest - (*AddKeyRangeRequest)(nil), // 4: spqr.AddKeyRangeRequest - (*SplitKeyRangeRequest)(nil), // 5: spqr.SplitKeyRangeRequest - (*MergeKeyRangeRequest)(nil), // 6: spqr.MergeKeyRangeRequest - (*MoveKeyRangeRequest)(nil), // 7: spqr.MoveKeyRangeRequest - (*DropKeyRangeRequest)(nil), // 8: spqr.DropKeyRangeRequest - (*DropAllKeyRangesRequest)(nil), // 9: spqr.DropAllKeyRangesRequest - (*DropAllKeyRangesResponse)(nil), // 10: spqr.DropAllKeyRangesResponse - (*LockKeyRangeRequest)(nil), // 11: spqr.LockKeyRangeRequest - (*UnlockKeyRangeRequest)(nil), // 12: spqr.UnlockKeyRangeRequest - (*KeyRangeReply)(nil), // 13: spqr.KeyRangeReply - (*ModifyReply)(nil), // 14: spqr.ModifyReply - (*ResolveKeyRangeRequest)(nil), // 15: spqr.ResolveKeyRangeRequest - (*ResolveKeyRangeReply)(nil), // 16: spqr.ResolveKeyRangeReply + (*ListAllKeyRangesRequest)(nil), // 4: spqr.ListAllKeyRangesRequest + (*AddKeyRangeRequest)(nil), // 5: spqr.AddKeyRangeRequest + (*SplitKeyRangeRequest)(nil), // 6: spqr.SplitKeyRangeRequest + (*MergeKeyRangeRequest)(nil), // 7: spqr.MergeKeyRangeRequest + (*MoveKeyRangeRequest)(nil), // 8: spqr.MoveKeyRangeRequest + (*DropKeyRangeRequest)(nil), // 9: spqr.DropKeyRangeRequest + (*DropAllKeyRangesRequest)(nil), // 10: spqr.DropAllKeyRangesRequest + (*DropAllKeyRangesResponse)(nil), // 11: spqr.DropAllKeyRangesResponse + (*LockKeyRangeRequest)(nil), // 12: spqr.LockKeyRangeRequest + (*UnlockKeyRangeRequest)(nil), // 13: spqr.UnlockKeyRangeRequest + (*KeyRangeReply)(nil), // 14: spqr.KeyRangeReply + (*ModifyReply)(nil), // 15: spqr.ModifyReply + (*ResolveKeyRangeRequest)(nil), // 16: spqr.ResolveKeyRangeRequest + (*ResolveKeyRangeReply)(nil), // 17: spqr.ResolveKeyRangeReply } var file_protos_key_range_proto_depIdxs = []int32{ 1, // 0: spqr.KeyRangeInfo.key_range:type_name -> spqr.KeyRange @@ -1042,27 +1087,29 @@ var file_protos_key_range_proto_depIdxs = []int32{ 2, // 4: spqr.DropAllKeyRangesResponse.key_range:type_name -> spqr.KeyRangeInfo 2, // 5: spqr.KeyRangeReply.key_ranges_info:type_name -> spqr.KeyRangeInfo 3, // 6: spqr.KeyRangeService.ListKeyRange:input_type -> spqr.ListKeyRangeRequest - 11, // 7: spqr.KeyRangeService.LockKeyRange:input_type -> spqr.LockKeyRangeRequest - 4, // 8: spqr.KeyRangeService.AddKeyRange:input_type -> spqr.AddKeyRangeRequest - 8, // 9: spqr.KeyRangeService.DropKeyRange:input_type -> spqr.DropKeyRangeRequest - 9, // 10: spqr.KeyRangeService.DropAllKeyRanges:input_type -> spqr.DropAllKeyRangesRequest - 12, // 11: spqr.KeyRangeService.UnlockKeyRange:input_type -> spqr.UnlockKeyRangeRequest - 5, // 12: spqr.KeyRangeService.SplitKeyRange:input_type -> spqr.SplitKeyRangeRequest - 6, // 13: spqr.KeyRangeService.MergeKeyRange:input_type -> spqr.MergeKeyRangeRequest - 7, // 14: spqr.KeyRangeService.MoveKeyRange:input_type -> spqr.MoveKeyRangeRequest - 15, // 15: spqr.KeyRangeService.ResolveKeyRange:input_type -> spqr.ResolveKeyRangeRequest - 13, // 16: spqr.KeyRangeService.ListKeyRange:output_type -> spqr.KeyRangeReply - 14, // 17: spqr.KeyRangeService.LockKeyRange:output_type -> spqr.ModifyReply - 14, // 18: spqr.KeyRangeService.AddKeyRange:output_type -> spqr.ModifyReply - 14, // 19: spqr.KeyRangeService.DropKeyRange:output_type -> spqr.ModifyReply - 10, // 20: spqr.KeyRangeService.DropAllKeyRanges:output_type -> spqr.DropAllKeyRangesResponse - 14, // 21: spqr.KeyRangeService.UnlockKeyRange:output_type -> spqr.ModifyReply - 14, // 22: spqr.KeyRangeService.SplitKeyRange:output_type -> spqr.ModifyReply - 14, // 23: spqr.KeyRangeService.MergeKeyRange:output_type -> spqr.ModifyReply - 14, // 24: spqr.KeyRangeService.MoveKeyRange:output_type -> spqr.ModifyReply - 16, // 25: spqr.KeyRangeService.ResolveKeyRange:output_type -> spqr.ResolveKeyRangeReply - 16, // [16:26] is the sub-list for method output_type - 6, // [6:16] is the sub-list for method input_type + 4, // 7: spqr.KeyRangeService.ListAllKeyRanges:input_type -> spqr.ListAllKeyRangesRequest + 12, // 8: spqr.KeyRangeService.LockKeyRange:input_type -> spqr.LockKeyRangeRequest + 5, // 9: spqr.KeyRangeService.AddKeyRange:input_type -> spqr.AddKeyRangeRequest + 9, // 10: spqr.KeyRangeService.DropKeyRange:input_type -> spqr.DropKeyRangeRequest + 10, // 11: spqr.KeyRangeService.DropAllKeyRanges:input_type -> spqr.DropAllKeyRangesRequest + 13, // 12: spqr.KeyRangeService.UnlockKeyRange:input_type -> spqr.UnlockKeyRangeRequest + 6, // 13: spqr.KeyRangeService.SplitKeyRange:input_type -> spqr.SplitKeyRangeRequest + 7, // 14: spqr.KeyRangeService.MergeKeyRange:input_type -> spqr.MergeKeyRangeRequest + 8, // 15: spqr.KeyRangeService.MoveKeyRange:input_type -> spqr.MoveKeyRangeRequest + 16, // 16: spqr.KeyRangeService.ResolveKeyRange:input_type -> spqr.ResolveKeyRangeRequest + 14, // 17: spqr.KeyRangeService.ListKeyRange:output_type -> spqr.KeyRangeReply + 14, // 18: spqr.KeyRangeService.ListAllKeyRanges:output_type -> spqr.KeyRangeReply + 15, // 19: spqr.KeyRangeService.LockKeyRange:output_type -> spqr.ModifyReply + 15, // 20: spqr.KeyRangeService.AddKeyRange:output_type -> spqr.ModifyReply + 15, // 21: spqr.KeyRangeService.DropKeyRange:output_type -> spqr.ModifyReply + 11, // 22: spqr.KeyRangeService.DropAllKeyRanges:output_type -> spqr.DropAllKeyRangesResponse + 15, // 23: spqr.KeyRangeService.UnlockKeyRange:output_type -> spqr.ModifyReply + 15, // 24: spqr.KeyRangeService.SplitKeyRange:output_type -> spqr.ModifyReply + 15, // 25: spqr.KeyRangeService.MergeKeyRange:output_type -> spqr.ModifyReply + 15, // 26: spqr.KeyRangeService.MoveKeyRange:output_type -> spqr.ModifyReply + 17, // 27: spqr.KeyRangeService.ResolveKeyRange:output_type -> spqr.ResolveKeyRangeReply + 17, // [17:28] is the sub-list for method output_type + 6, // [6:17] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension extendee 0, // [0:6] is the sub-list for field type_name @@ -1111,7 +1158,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddKeyRangeRequest); i { + switch v := v.(*ListAllKeyRangesRequest); i { case 0: return &v.state case 1: @@ -1123,7 +1170,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SplitKeyRangeRequest); i { + switch v := v.(*AddKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1135,7 +1182,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MergeKeyRangeRequest); i { + switch v := v.(*SplitKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1147,7 +1194,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoveKeyRangeRequest); i { + switch v := v.(*MergeKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1159,7 +1206,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DropKeyRangeRequest); i { + switch v := v.(*MoveKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1171,7 +1218,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DropAllKeyRangesRequest); i { + switch v := v.(*DropKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1183,7 +1230,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DropAllKeyRangesResponse); i { + switch v := v.(*DropAllKeyRangesRequest); i { case 0: return &v.state case 1: @@ -1195,7 +1242,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LockKeyRangeRequest); i { + switch v := v.(*DropAllKeyRangesResponse); i { case 0: return &v.state case 1: @@ -1207,7 +1254,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnlockKeyRangeRequest); i { + switch v := v.(*LockKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1219,7 +1266,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyRangeReply); i { + switch v := v.(*UnlockKeyRangeRequest); i { case 0: return &v.state case 1: @@ -1231,7 +1278,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModifyReply); i { + switch v := v.(*KeyRangeReply); i { case 0: return &v.state case 1: @@ -1243,7 +1290,7 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResolveKeyRangeRequest); i { + switch v := v.(*ModifyReply); i { case 0: return &v.state case 1: @@ -1255,6 +1302,18 @@ func file_protos_key_range_proto_init() { } } file_protos_key_range_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResolveKeyRangeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_key_range_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResolveKeyRangeReply); i { case 0: return &v.state @@ -1273,7 +1332,7 @@ func file_protos_key_range_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_key_range_proto_rawDesc, NumEnums: 1, - NumMessages: 16, + NumMessages: 17, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/protos/key_range_grpc.pb.go b/pkg/protos/key_range_grpc.pb.go index 97d3466b7..741a5cef4 100644 --- a/pkg/protos/key_range_grpc.pb.go +++ b/pkg/protos/key_range_grpc.pb.go @@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( KeyRangeService_ListKeyRange_FullMethodName = "/spqr.KeyRangeService/ListKeyRange" + KeyRangeService_ListAllKeyRanges_FullMethodName = "/spqr.KeyRangeService/ListAllKeyRanges" KeyRangeService_LockKeyRange_FullMethodName = "/spqr.KeyRangeService/LockKeyRange" KeyRangeService_AddKeyRange_FullMethodName = "/spqr.KeyRangeService/AddKeyRange" KeyRangeService_DropKeyRange_FullMethodName = "/spqr.KeyRangeService/DropKeyRange" @@ -36,6 +37,7 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type KeyRangeServiceClient interface { ListKeyRange(ctx context.Context, in *ListKeyRangeRequest, opts ...grpc.CallOption) (*KeyRangeReply, error) + ListAllKeyRanges(ctx context.Context, in *ListAllKeyRangesRequest, opts ...grpc.CallOption) (*KeyRangeReply, error) LockKeyRange(ctx context.Context, in *LockKeyRangeRequest, opts ...grpc.CallOption) (*ModifyReply, error) AddKeyRange(ctx context.Context, in *AddKeyRangeRequest, opts ...grpc.CallOption) (*ModifyReply, error) DropKeyRange(ctx context.Context, in *DropKeyRangeRequest, opts ...grpc.CallOption) (*ModifyReply, error) @@ -64,6 +66,15 @@ func (c *keyRangeServiceClient) ListKeyRange(ctx context.Context, in *ListKeyRan return out, nil } +func (c *keyRangeServiceClient) ListAllKeyRanges(ctx context.Context, in *ListAllKeyRangesRequest, opts ...grpc.CallOption) (*KeyRangeReply, error) { + out := new(KeyRangeReply) + err := c.cc.Invoke(ctx, KeyRangeService_ListAllKeyRanges_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *keyRangeServiceClient) LockKeyRange(ctx context.Context, in *LockKeyRangeRequest, opts ...grpc.CallOption) (*ModifyReply, error) { out := new(ModifyReply) err := c.cc.Invoke(ctx, KeyRangeService_LockKeyRange_FullMethodName, in, out, opts...) @@ -150,6 +161,7 @@ func (c *keyRangeServiceClient) ResolveKeyRange(ctx context.Context, in *Resolve // for forward compatibility type KeyRangeServiceServer interface { ListKeyRange(context.Context, *ListKeyRangeRequest) (*KeyRangeReply, error) + ListAllKeyRanges(context.Context, *ListAllKeyRangesRequest) (*KeyRangeReply, error) LockKeyRange(context.Context, *LockKeyRangeRequest) (*ModifyReply, error) AddKeyRange(context.Context, *AddKeyRangeRequest) (*ModifyReply, error) DropKeyRange(context.Context, *DropKeyRangeRequest) (*ModifyReply, error) @@ -169,6 +181,9 @@ type UnimplementedKeyRangeServiceServer struct { func (UnimplementedKeyRangeServiceServer) ListKeyRange(context.Context, *ListKeyRangeRequest) (*KeyRangeReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ListKeyRange not implemented") } +func (UnimplementedKeyRangeServiceServer) ListAllKeyRanges(context.Context, *ListAllKeyRangesRequest) (*KeyRangeReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAllKeyRanges not implemented") +} func (UnimplementedKeyRangeServiceServer) LockKeyRange(context.Context, *LockKeyRangeRequest) (*ModifyReply, error) { return nil, status.Errorf(codes.Unimplemented, "method LockKeyRange not implemented") } @@ -227,6 +242,24 @@ func _KeyRangeService_ListKeyRange_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _KeyRangeService_ListAllKeyRanges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAllKeyRangesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KeyRangeServiceServer).ListAllKeyRanges(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KeyRangeService_ListAllKeyRanges_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KeyRangeServiceServer).ListAllKeyRanges(ctx, req.(*ListAllKeyRangesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _KeyRangeService_LockKeyRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LockKeyRangeRequest) if err := dec(in); err != nil { @@ -400,6 +433,10 @@ var KeyRangeService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListKeyRange", Handler: _KeyRangeService_ListKeyRange_Handler, }, + { + MethodName: "ListAllKeyRanges", + Handler: _KeyRangeService_ListAllKeyRanges_Handler, + }, { MethodName: "LockKeyRange", Handler: _KeyRangeService_LockKeyRange_Handler, diff --git a/protos/key_range.proto b/protos/key_range.proto index 26dbbad79..e92d3a6fd 100644 --- a/protos/key_range.proto +++ b/protos/key_range.proto @@ -6,6 +6,7 @@ option go_package = "spqr/proto"; service KeyRangeService { rpc ListKeyRange (ListKeyRangeRequest) returns (KeyRangeReply) {} + rpc ListAllKeyRanges (ListAllKeyRangesRequest) returns (KeyRangeReply) {} rpc LockKeyRange (LockKeyRangeRequest) returns (ModifyReply) {} rpc AddKeyRange(AddKeyRangeRequest) returns (ModifyReply) {} rpc DropKeyRange(DropKeyRangeRequest) returns (ModifyReply) {} @@ -39,6 +40,8 @@ message ListKeyRangeRequest { string distribution = 1; } +message ListAllKeyRangesRequest { } + message AddKeyRangeRequest { KeyRangeInfo key_range_info = 1; } diff --git a/router/grpc/qrouter.go b/router/grpc/qrouter.go index 94b79dc2c..b2c18e92e 100644 --- a/router/grpc/qrouter.go +++ b/router/grpc/qrouter.go @@ -215,6 +215,22 @@ func (l *LocalQrouterServer) ListKeyRange(ctx context.Context, request *protos.L }, nil } +// TODO : unit tests +func (l *LocalQrouterServer) ListAllKeyRanges(ctx context.Context, request *protos.ListAllKeyRangesRequest) (*protos.KeyRangeReply, error) { + krsDb, err := l.mgr.ListAllKeyRanges(ctx) + if err != nil { + return nil, err + } + + krs := make([]*protos.KeyRangeInfo, len(krsDb)) + + for i, krg := range krsDb { + krs[i] = krg.ToProto() + } + + return &protos.KeyRangeReply{KeyRangesInfo: krs}, nil +} + // TODO : unit tests func (l *LocalQrouterServer) LockKeyRange(ctx context.Context, request *protos.LockKeyRangeRequest) (*protos.ModifyReply, error) { for _, id := range request.Id { diff --git a/test/feature/docker-compose.yaml b/test/feature/docker-compose.yaml index 167d1f304..f170344f3 100644 --- a/test/feature/docker-compose.yaml +++ b/test/feature/docker-compose.yaml @@ -49,6 +49,11 @@ services: condition: service_healthy shard2: condition: service_healthy + healthcheck: + test: psql -h regress_router_2 -p 6432 -U regress -d regress + interval: 10s + timeout: 3s + retries: 50 router2: build: @@ -69,6 +74,11 @@ services: condition: service_healthy shard2: condition: service_healthy + healthcheck: + test: psql -h regress_router_2 -p 6432 -U regress -d regress + interval: 10s + timeout: 3s + retries: 50 coordinator: build: diff --git a/test/feature/features/dumper.feature b/test/feature/features/dumper.feature new file mode 100644 index 000000000..cb2b0a321 --- /dev/null +++ b/test/feature/features/dumper.feature @@ -0,0 +1,83 @@ +Feature: spqrdump test + Background: + # + # Make host "coordinator" take control + # + Given cluster is up and running + And host "coordinator2" is stopped + And host "coordinator2" is started + + When I run SQL on host "coordinator" + """ + REGISTER ROUTER r1 ADDRESS regress_router::7000 + """ + Then command return code should be "0" + + Scenario: dump via GRPC works + When I run SQL on host "coordinator" + """ + CREATE DISTRIBUTION ds1 COLUMN TYPES integer; + CREATE KEY RANGE krid1 FROM 0 ROUTE TO sh1 FOR DISTRIBUTION ds1; + CREATE KEY RANGE krid2 FROM 11 ROUTE TO sh2 FOR DISTRIBUTION ds1; + ALTER DISTRIBUTION ds1 ATTACH RELATION test DISTRIBUTION KEY id; + """ + Then command return code should be "0" + + When I run command on host "router" + """ + /spqr/spqrdump dump -e regress_router:7000 + """ + Then command return code should be "0" + And command output should match regexp + """ + CREATE DISTRIBUTION ds1 COLUMN TYPES integer; + ALTER DISTRIBUTION ds1 ATTACH RELATION test DISTRIBUTION KEY id; + CREATE KEY RANGE krid1 FROM 0 ROUTE TO sh1 FOR DISTRIBUTION ds1; + CREATE KEY RANGE krid2 FROM 11 ROUTE TO sh2 FOR DISTRIBUTION ds1; + """ + + Scenario: dump via GRPC works with multidimensional distribution key + When I run SQL on host "coordinator" + """ + CREATE DISTRIBUTION ds1 COLUMN TYPES integer, varchar; + CREATE KEY RANGE krid1 FROM 0 ROUTE TO sh1 FOR DISTRIBUTION ds1; + CREATE KEY RANGE krid2 FROM 11 ROUTE TO sh2 FOR DISTRIBUTION ds1; + ALTER DISTRIBUTION ds1 ATTACH RELATION test DISTRIBUTION KEY id, id_2; + """ + Then command return code should be "0" + + When I run command on host "router" + """ + /spqr/spqrdump dump -e regress_router:7000 + """ + Then command return code should be "0" + And command output should match regexp + """ + CREATE DISTRIBUTION ds1 COLUMN TYPES integer, varchar; + ALTER DISTRIBUTION ds1 ATTACH RELATION test DISTRIBUTION KEY id, id_2; + CREATE KEY RANGE krid1 FROM 0 ROUTE TO sh1 FOR DISTRIBUTION ds1; + CREATE KEY RANGE krid2 FROM 11 ROUTE TO sh2 FOR DISTRIBUTION ds1; + """ + + Scenario: dump via GRPC works with hashed distribution key + When I run SQL on host "coordinator" + """ + CREATE DISTRIBUTION ds1 COLUMN TYPES integer; + CREATE KEY RANGE krid1 FROM 0 ROUTE TO sh1 FOR DISTRIBUTION ds1; + CREATE KEY RANGE krid2 FROM 11 ROUTE TO sh2 FOR DISTRIBUTION ds1; + ALTER DISTRIBUTION ds1 ATTACH RELATION test DISTRIBUTION KEY id HASH FUNCTION murmur; + """ + Then command return code should be "0" + + When I run command on host "router" + """ + /spqr/spqrdump dump -e regress_router:7000 + """ + Then command return code should be "0" + And command output should match regexp + """ + CREATE DISTRIBUTION ds1 COLUMN TYPES integer; + ALTER DISTRIBUTION ds1 ATTACH RELATION test DISTRIBUTION KEY id HASH FUNCTION murmur; + CREATE KEY RANGE krid1 FROM 0 ROUTE TO sh1 FOR DISTRIBUTION ds1; + CREATE KEY RANGE krid2 FROM 11 ROUTE TO sh2 FOR DISTRIBUTION ds1; + """ diff --git a/test/feature/testutil/docker_composer.go b/test/feature/testutil/docker_composer.go index d6d9beeff..b8841170f 100644 --- a/test/feature/testutil/docker_composer.go +++ b/test/feature/testutil/docker_composer.go @@ -2,6 +2,7 @@ package testutil import ( "archive/tar" + "bytes" "context" "fmt" "io" @@ -17,6 +18,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" + "github.com/docker/docker/pkg/stdcopy" ) const defaultDockerTimeout = 30 * time.Second @@ -222,7 +224,12 @@ func (dc *DockerComposer) RunCommand(service string, cmd string, timeout time.Du if err != nil { return 0, "", err } - output, err := io.ReadAll(attachResp.Reader) + var outBuf, errBuf bytes.Buffer + _, err = stdcopy.StdCopy(&outBuf, &errBuf, attachResp.Reader) + if err != nil { + return 0, "", fmt.Errorf("failed demultiplexing exec output") + } + output, err := io.ReadAll(&outBuf) attachResp.Close() if err != nil { return 0, "", err diff --git a/test/feature/testutil/matchers/matchers.go b/test/feature/testutil/matchers/matchers.go index 341c71580..d10a9724e 100644 --- a/test/feature/testutil/matchers/matchers.go +++ b/test/feature/testutil/matchers/matchers.go @@ -154,7 +154,7 @@ func JSONExactlyMatcher(actual string, expected string) error { return nil } -// GetMatcher returns registred matcher by name +// GetMatcher returns registered matcher by name func GetMatcher(name string) (Matcher, error) { if matcher, ok := registry[name]; ok { return matcher, nil