File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ syntax = "proto3" ;
2+ package coprocessor_v2 ;
3+
4+ import "errorpb.proto" ;
5+ import "kvrpcpb.proto" ;
6+ import "gogoproto/gogo.proto" ;
7+ import "rustproto.proto" ;
8+
9+ option (gogoproto.marshaler_all ) = true ;
10+ option (gogoproto.sizer_all ) = true ;
11+ option (gogoproto.unmarshaler_all ) = true ;
12+ option (rustproto.lite_runtime_all ) = true ;
13+
14+ option java_package = "org.tikv.kvproto" ;
15+
16+ message RawCoprocessorRequest {
17+ kvrpcpb.Context context = 1 ;
18+
19+ string copr_name = 2 ;
20+ string copr_version_constraint = 3 ;
21+
22+ bytes data = 4 ;
23+ }
24+
25+ message RawCoprocessorResponse {
26+ bytes data = 1 ;
27+
28+ errorpb.Error region_error = 2 ;
29+
30+ // Error message for cases like if no coprocessor with a matching name is found
31+ // or on a version mismatch between plugin_api and the coprocessor.
32+ string other_error = 4 ;
33+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ syntax = "proto3";
22package tikvpb ;
33
44import "coprocessor.proto" ;
5+ import "coprocessor_v2.proto" ;
56import "kvrpcpb.proto" ;
67import "mpp.proto" ;
78import "raft_serverpb.proto" ;
@@ -69,6 +70,9 @@ service Tikv {
6970 rpc CoprocessorStream (coprocessor .Request ) returns (stream coprocessor .Response ) {}
7071 rpc BatchCoprocessor (coprocessor .BatchRequest ) returns (stream coprocessor .BatchResponse ) {}
7172
73+ // Command for executing custom user requests in TiKV coprocessor_v2.
74+ rpc CoprocessorV2 (coprocessor_v2 .RawCoprocessorRequest ) returns (coprocessor_v2 .RawCoprocessorResponse ) {}
75+
7276 // Raft commands (sent between TiKV nodes).
7377 rpc Raft (stream raft_serverpb .RaftMessage ) returns (raft_serverpb .Done ) {}
7478 rpc BatchRaft (stream BatchRaftMessage ) returns (raft_serverpb .Done ) {}
@@ -144,6 +148,8 @@ message BatchCommandsRequest {
144148
145149 kvrpcpb.CheckSecondaryLocksRequest CheckSecondaryLocks = 33 ;
146150
151+ coprocessor_v2.RawCoprocessorRequest CoprocessorV2 = 34 ;
152+
147153 // For some test cases.
148154 BatchCommandsEmptyRequest Empty = 255 ;
149155 }
@@ -197,6 +203,8 @@ message BatchCommandsResponse {
197203
198204 kvrpcpb.CheckSecondaryLocksResponse CheckSecondaryLocks = 33 ;
199205
206+ coprocessor_v2.RawCoprocessorResponse CoprocessorV2 = 34 ;
207+
200208 // For some test cases.
201209 BatchCommandsEmptyResponse Empty = 255 ;
202210 }
You can’t perform that action at this time.
0 commit comments