Skip to content

Commit

Permalink
proxy: support HashKV in grpcproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
fanminshi committed Jul 14, 2017
1 parent dd1c11e commit 565e447
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proxy/grpcproxy/adapter/maintenance_client_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ func (s *mts2mtc) Hash(ctx context.Context, r *pb.HashRequest, opts ...grpc.Call
return s.mts.Hash(ctx, r)
}

func (s *mts2mtc) HashKV(ctx context.Context, r *pb.HashKVRequest, opts ...grpc.CallOption) (*pb.HashKVResponse, error) {
return s.mts.HashKV(ctx, r)
}

func (s *mts2mtc) MoveLeader(ctx context.Context, r *pb.MoveLeaderRequest, opts ...grpc.CallOption) (*pb.MoveLeaderResponse, error) {
return s.mts.MoveLeader(ctx, r)
}
Expand Down
5 changes: 5 additions & 0 deletions proxy/grpcproxy/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func (mp *maintenanceProxy) Hash(ctx context.Context, r *pb.HashRequest) (*pb.Ha
return pb.NewMaintenanceClient(conn).Hash(ctx, r)
}

func (mp *maintenanceProxy) HashKV(ctx context.Context, r *pb.HashKVRequest) (*pb.HashKVResponse, error) {
conn := mp.client.ActiveConnection()
return pb.NewMaintenanceClient(conn).HashKV(ctx, r)
}

func (mp *maintenanceProxy) Alarm(ctx context.Context, r *pb.AlarmRequest) (*pb.AlarmResponse, error) {
conn := mp.client.ActiveConnection()
return pb.NewMaintenanceClient(conn).Alarm(ctx, r)
Expand Down

0 comments on commit 565e447

Please sign in to comment.