mirror of
https://github.com/talent-plan/tinykv.git
synced 2025-01-13 13:50:43 +08:00
5e089a2cd1
Signed-off-by: Connor <zbk602423539@gmail.com> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: linning <linningde25@gmail.com> Co-authored-by: YangKeao <keao.yang@yahoo.com> Co-authored-by: andylokandy <andylokandy@hotmail.com> Co-authored-by: Iosmanthus Teng <myosmanthustree@gmail.com>
648 lines
23 KiB
Go
648 lines
23 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: tinykvpb.proto
|
|
|
|
package tinykvpb
|
|
|
|
import (
|
|
"fmt"
|
|
"math"
|
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
|
|
coprocessor "github.com/pingcap-incubator/tinykv/proto/pkg/coprocessor"
|
|
|
|
kvrpcpb "github.com/pingcap-incubator/tinykv/proto/pkg/kvrpcpb"
|
|
|
|
raft_serverpb "github.com/pingcap-incubator/tinykv/proto/pkg/raft_serverpb"
|
|
|
|
context "golang.org/x/net/context"
|
|
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for TinyKv service
|
|
|
|
type TinyKvClient interface {
|
|
// KV commands with mvcc/txn supported.
|
|
KvGet(ctx context.Context, in *kvrpcpb.GetRequest, opts ...grpc.CallOption) (*kvrpcpb.GetResponse, error)
|
|
KvScan(ctx context.Context, in *kvrpcpb.ScanRequest, opts ...grpc.CallOption) (*kvrpcpb.ScanResponse, error)
|
|
KvPrewrite(ctx context.Context, in *kvrpcpb.PrewriteRequest, opts ...grpc.CallOption) (*kvrpcpb.PrewriteResponse, error)
|
|
KvCommit(ctx context.Context, in *kvrpcpb.CommitRequest, opts ...grpc.CallOption) (*kvrpcpb.CommitResponse, error)
|
|
KvCheckTxnStatus(ctx context.Context, in *kvrpcpb.CheckTxnStatusRequest, opts ...grpc.CallOption) (*kvrpcpb.CheckTxnStatusResponse, error)
|
|
KvBatchRollback(ctx context.Context, in *kvrpcpb.BatchRollbackRequest, opts ...grpc.CallOption) (*kvrpcpb.BatchRollbackResponse, error)
|
|
KvResolveLock(ctx context.Context, in *kvrpcpb.ResolveLockRequest, opts ...grpc.CallOption) (*kvrpcpb.ResolveLockResponse, error)
|
|
// RawKV commands.
|
|
RawGet(ctx context.Context, in *kvrpcpb.RawGetRequest, opts ...grpc.CallOption) (*kvrpcpb.RawGetResponse, error)
|
|
RawPut(ctx context.Context, in *kvrpcpb.RawPutRequest, opts ...grpc.CallOption) (*kvrpcpb.RawPutResponse, error)
|
|
RawDelete(ctx context.Context, in *kvrpcpb.RawDeleteRequest, opts ...grpc.CallOption) (*kvrpcpb.RawDeleteResponse, error)
|
|
RawScan(ctx context.Context, in *kvrpcpb.RawScanRequest, opts ...grpc.CallOption) (*kvrpcpb.RawScanResponse, error)
|
|
// Raft commands (tinykv <-> tinykv).
|
|
Raft(ctx context.Context, opts ...grpc.CallOption) (TinyKv_RaftClient, error)
|
|
Snapshot(ctx context.Context, opts ...grpc.CallOption) (TinyKv_SnapshotClient, error)
|
|
// Coprocessor
|
|
Coprocessor(ctx context.Context, in *coprocessor.Request, opts ...grpc.CallOption) (*coprocessor.Response, error)
|
|
}
|
|
|
|
type tinyKvClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewTinyKvClient(cc *grpc.ClientConn) TinyKvClient {
|
|
return &tinyKvClient{cc}
|
|
}
|
|
|
|
func (c *tinyKvClient) KvGet(ctx context.Context, in *kvrpcpb.GetRequest, opts ...grpc.CallOption) (*kvrpcpb.GetResponse, error) {
|
|
out := new(kvrpcpb.GetResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvGet", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) KvScan(ctx context.Context, in *kvrpcpb.ScanRequest, opts ...grpc.CallOption) (*kvrpcpb.ScanResponse, error) {
|
|
out := new(kvrpcpb.ScanResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvScan", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) KvPrewrite(ctx context.Context, in *kvrpcpb.PrewriteRequest, opts ...grpc.CallOption) (*kvrpcpb.PrewriteResponse, error) {
|
|
out := new(kvrpcpb.PrewriteResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvPrewrite", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) KvCommit(ctx context.Context, in *kvrpcpb.CommitRequest, opts ...grpc.CallOption) (*kvrpcpb.CommitResponse, error) {
|
|
out := new(kvrpcpb.CommitResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvCommit", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) KvCheckTxnStatus(ctx context.Context, in *kvrpcpb.CheckTxnStatusRequest, opts ...grpc.CallOption) (*kvrpcpb.CheckTxnStatusResponse, error) {
|
|
out := new(kvrpcpb.CheckTxnStatusResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvCheckTxnStatus", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) KvBatchRollback(ctx context.Context, in *kvrpcpb.BatchRollbackRequest, opts ...grpc.CallOption) (*kvrpcpb.BatchRollbackResponse, error) {
|
|
out := new(kvrpcpb.BatchRollbackResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvBatchRollback", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) KvResolveLock(ctx context.Context, in *kvrpcpb.ResolveLockRequest, opts ...grpc.CallOption) (*kvrpcpb.ResolveLockResponse, error) {
|
|
out := new(kvrpcpb.ResolveLockResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/KvResolveLock", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) RawGet(ctx context.Context, in *kvrpcpb.RawGetRequest, opts ...grpc.CallOption) (*kvrpcpb.RawGetResponse, error) {
|
|
out := new(kvrpcpb.RawGetResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/RawGet", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) RawPut(ctx context.Context, in *kvrpcpb.RawPutRequest, opts ...grpc.CallOption) (*kvrpcpb.RawPutResponse, error) {
|
|
out := new(kvrpcpb.RawPutResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/RawPut", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) RawDelete(ctx context.Context, in *kvrpcpb.RawDeleteRequest, opts ...grpc.CallOption) (*kvrpcpb.RawDeleteResponse, error) {
|
|
out := new(kvrpcpb.RawDeleteResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/RawDelete", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) RawScan(ctx context.Context, in *kvrpcpb.RawScanRequest, opts ...grpc.CallOption) (*kvrpcpb.RawScanResponse, error) {
|
|
out := new(kvrpcpb.RawScanResponse)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/RawScan", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) Raft(ctx context.Context, opts ...grpc.CallOption) (TinyKv_RaftClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_TinyKv_serviceDesc.Streams[0], "/tinykvpb.TinyKv/Raft", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &tinyKvRaftClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type TinyKv_RaftClient interface {
|
|
Send(*raft_serverpb.RaftMessage) error
|
|
CloseAndRecv() (*raft_serverpb.Done, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type tinyKvRaftClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *tinyKvRaftClient) Send(m *raft_serverpb.RaftMessage) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *tinyKvRaftClient) CloseAndRecv() (*raft_serverpb.Done, error) {
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
m := new(raft_serverpb.Done)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) Snapshot(ctx context.Context, opts ...grpc.CallOption) (TinyKv_SnapshotClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_TinyKv_serviceDesc.Streams[1], "/tinykvpb.TinyKv/Snapshot", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &tinyKvSnapshotClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type TinyKv_SnapshotClient interface {
|
|
Send(*raft_serverpb.SnapshotChunk) error
|
|
CloseAndRecv() (*raft_serverpb.Done, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type tinyKvSnapshotClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *tinyKvSnapshotClient) Send(m *raft_serverpb.SnapshotChunk) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *tinyKvSnapshotClient) CloseAndRecv() (*raft_serverpb.Done, error) {
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
m := new(raft_serverpb.Done)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *tinyKvClient) Coprocessor(ctx context.Context, in *coprocessor.Request, opts ...grpc.CallOption) (*coprocessor.Response, error) {
|
|
out := new(coprocessor.Response)
|
|
err := c.cc.Invoke(ctx, "/tinykvpb.TinyKv/Coprocessor", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for TinyKv service
|
|
|
|
type TinyKvServer interface {
|
|
// KV commands with mvcc/txn supported.
|
|
KvGet(context.Context, *kvrpcpb.GetRequest) (*kvrpcpb.GetResponse, error)
|
|
KvScan(context.Context, *kvrpcpb.ScanRequest) (*kvrpcpb.ScanResponse, error)
|
|
KvPrewrite(context.Context, *kvrpcpb.PrewriteRequest) (*kvrpcpb.PrewriteResponse, error)
|
|
KvCommit(context.Context, *kvrpcpb.CommitRequest) (*kvrpcpb.CommitResponse, error)
|
|
KvCheckTxnStatus(context.Context, *kvrpcpb.CheckTxnStatusRequest) (*kvrpcpb.CheckTxnStatusResponse, error)
|
|
KvBatchRollback(context.Context, *kvrpcpb.BatchRollbackRequest) (*kvrpcpb.BatchRollbackResponse, error)
|
|
KvResolveLock(context.Context, *kvrpcpb.ResolveLockRequest) (*kvrpcpb.ResolveLockResponse, error)
|
|
// RawKV commands.
|
|
RawGet(context.Context, *kvrpcpb.RawGetRequest) (*kvrpcpb.RawGetResponse, error)
|
|
RawPut(context.Context, *kvrpcpb.RawPutRequest) (*kvrpcpb.RawPutResponse, error)
|
|
RawDelete(context.Context, *kvrpcpb.RawDeleteRequest) (*kvrpcpb.RawDeleteResponse, error)
|
|
RawScan(context.Context, *kvrpcpb.RawScanRequest) (*kvrpcpb.RawScanResponse, error)
|
|
// Raft commands (tinykv <-> tinykv).
|
|
Raft(TinyKv_RaftServer) error
|
|
Snapshot(TinyKv_SnapshotServer) error
|
|
// Coprocessor
|
|
Coprocessor(context.Context, *coprocessor.Request) (*coprocessor.Response, error)
|
|
}
|
|
|
|
func RegisterTinyKvServer(s *grpc.Server, srv TinyKvServer) {
|
|
s.RegisterService(&_TinyKv_serviceDesc, srv)
|
|
}
|
|
|
|
func _TinyKv_KvGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.GetRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvGet(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvGet",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvGet(ctx, req.(*kvrpcpb.GetRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_KvScan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.ScanRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvScan(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvScan",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvScan(ctx, req.(*kvrpcpb.ScanRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_KvPrewrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.PrewriteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvPrewrite(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvPrewrite",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvPrewrite(ctx, req.(*kvrpcpb.PrewriteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_KvCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.CommitRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvCommit(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvCommit",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvCommit(ctx, req.(*kvrpcpb.CommitRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_KvCheckTxnStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.CheckTxnStatusRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvCheckTxnStatus(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvCheckTxnStatus",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvCheckTxnStatus(ctx, req.(*kvrpcpb.CheckTxnStatusRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_KvBatchRollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.BatchRollbackRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvBatchRollback(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvBatchRollback",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvBatchRollback(ctx, req.(*kvrpcpb.BatchRollbackRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_KvResolveLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.ResolveLockRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).KvResolveLock(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/KvResolveLock",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).KvResolveLock(ctx, req.(*kvrpcpb.ResolveLockRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_RawGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.RawGetRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).RawGet(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/RawGet",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).RawGet(ctx, req.(*kvrpcpb.RawGetRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_RawPut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.RawPutRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).RawPut(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/RawPut",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).RawPut(ctx, req.(*kvrpcpb.RawPutRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_RawDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.RawDeleteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).RawDelete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/RawDelete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).RawDelete(ctx, req.(*kvrpcpb.RawDeleteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_RawScan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(kvrpcpb.RawScanRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).RawScan(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/RawScan",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).RawScan(ctx, req.(*kvrpcpb.RawScanRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TinyKv_Raft_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(TinyKvServer).Raft(&tinyKvRaftServer{stream})
|
|
}
|
|
|
|
type TinyKv_RaftServer interface {
|
|
SendAndClose(*raft_serverpb.Done) error
|
|
Recv() (*raft_serverpb.RaftMessage, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type tinyKvRaftServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *tinyKvRaftServer) SendAndClose(m *raft_serverpb.Done) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *tinyKvRaftServer) Recv() (*raft_serverpb.RaftMessage, error) {
|
|
m := new(raft_serverpb.RaftMessage)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func _TinyKv_Snapshot_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(TinyKvServer).Snapshot(&tinyKvSnapshotServer{stream})
|
|
}
|
|
|
|
type TinyKv_SnapshotServer interface {
|
|
SendAndClose(*raft_serverpb.Done) error
|
|
Recv() (*raft_serverpb.SnapshotChunk, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type tinyKvSnapshotServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *tinyKvSnapshotServer) SendAndClose(m *raft_serverpb.Done) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *tinyKvSnapshotServer) Recv() (*raft_serverpb.SnapshotChunk, error) {
|
|
m := new(raft_serverpb.SnapshotChunk)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func _TinyKv_Coprocessor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(coprocessor.Request)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TinyKvServer).Coprocessor(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/tinykvpb.TinyKv/Coprocessor",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TinyKvServer).Coprocessor(ctx, req.(*coprocessor.Request))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _TinyKv_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "tinykvpb.TinyKv",
|
|
HandlerType: (*TinyKvServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "KvGet",
|
|
Handler: _TinyKv_KvGet_Handler,
|
|
},
|
|
{
|
|
MethodName: "KvScan",
|
|
Handler: _TinyKv_KvScan_Handler,
|
|
},
|
|
{
|
|
MethodName: "KvPrewrite",
|
|
Handler: _TinyKv_KvPrewrite_Handler,
|
|
},
|
|
{
|
|
MethodName: "KvCommit",
|
|
Handler: _TinyKv_KvCommit_Handler,
|
|
},
|
|
{
|
|
MethodName: "KvCheckTxnStatus",
|
|
Handler: _TinyKv_KvCheckTxnStatus_Handler,
|
|
},
|
|
{
|
|
MethodName: "KvBatchRollback",
|
|
Handler: _TinyKv_KvBatchRollback_Handler,
|
|
},
|
|
{
|
|
MethodName: "KvResolveLock",
|
|
Handler: _TinyKv_KvResolveLock_Handler,
|
|
},
|
|
{
|
|
MethodName: "RawGet",
|
|
Handler: _TinyKv_RawGet_Handler,
|
|
},
|
|
{
|
|
MethodName: "RawPut",
|
|
Handler: _TinyKv_RawPut_Handler,
|
|
},
|
|
{
|
|
MethodName: "RawDelete",
|
|
Handler: _TinyKv_RawDelete_Handler,
|
|
},
|
|
{
|
|
MethodName: "RawScan",
|
|
Handler: _TinyKv_RawScan_Handler,
|
|
},
|
|
{
|
|
MethodName: "Coprocessor",
|
|
Handler: _TinyKv_Coprocessor_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Raft",
|
|
Handler: _TinyKv_Raft_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
{
|
|
StreamName: "Snapshot",
|
|
Handler: _TinyKv_Snapshot_Handler,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "tinykvpb.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("tinykvpb.proto", fileDescriptor_tinykvpb_71a6ae942ac295c5) }
|
|
|
|
var fileDescriptor_tinykvpb_71a6ae942ac295c5 = []byte{
|
|
// 452 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xdb, 0x6e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