-
Notifications
You must be signed in to change notification settings - Fork 219
/
coprocessor.proto
126 lines (106 loc) · 3.98 KB
/
coprocessor.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
syntax = "proto3";
package coprocessor;
import "errorpb.proto";
import "kvrpcpb.proto";
import "metapb.proto";
import "gogoproto/gogo.proto";
import "rustproto.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.goproto_unkeyed_all) = false;
option (gogoproto.goproto_unrecognized_all) = false;
option (gogoproto.goproto_sizecache_all) = false;
option (rustproto.lite_runtime_all) = true;
option java_package = "org.tikv.kvproto";
// [start, end)
message KeyRange {
bytes start = 1;
bytes end = 2;
}
message Request {
kvrpcpb.Context context = 1;
int64 tp = 2;
bytes data = 3;
uint64 start_ts = 7;
repeated KeyRange ranges = 4;
// If cache is enabled, TiKV returns cache hit instead of data if
// its last version matches this `cache_if_match_version`.
bool is_cache_enabled = 5;
uint64 cache_if_match_version = 6;
// Any schema-ful storage to validate schema correctness if necessary.
int64 schema_ver = 8;
bool is_trace_enabled = 9;
// paging_size is 0 when it's disabled, otherwise, it should be a positive number.
uint64 paging_size = 10;
// tasks stores the batched coprocessor tasks sent to the same tikv store.
repeated StoreBatchTask tasks = 11;
uint64 connection_id = 12; // This is the session id between a client and tidb
string connection_alias = 13; // This is the session alias between a client and tidb
}
message Response {
bytes data = 1 [(gogoproto.customtype) = "github.com/pingcap/kvproto/pkg/sharedbytes.SharedBytes", (gogoproto.nullable) = false];
errorpb.Error region_error = 2;
kvrpcpb.LockInfo locked = 3;
string other_error = 4;
KeyRange range = 5;
// This field is always filled for compatibility consideration. However
// newer TiDB should respect `exec_details_v2` field instead.
kvrpcpb.ExecDetails exec_details = 6;
// This field is provided in later versions, containing more detailed
// information.
kvrpcpb.ExecDetailsV2 exec_details_v2 = 11;
bool is_cache_hit = 7;
uint64 cache_last_version = 8;
bool can_be_cached = 9;
reserved 10;
// Contains the latest buckets version of the region.
// Clients should query PD to update buckets in cache if its is stale.
uint64 latest_buckets_version = 12;
// StoreBatchTaskResponse is the collection of batch task responses.
repeated StoreBatchTaskResponse batch_responses = 13;
}
message RegionInfo {
uint64 region_id = 1;
metapb.RegionEpoch region_epoch = 2;
repeated KeyRange ranges = 3;
}
message TableRegions {
int64 physical_table_id = 1;
repeated RegionInfo regions = 2;
}
message BatchRequest {
kvrpcpb.Context context = 1;
int64 tp = 2;
bytes data = 3;
repeated RegionInfo regions = 4;
uint64 start_ts = 5;
// Any schema-ful storage to validate schema correctness if necessary.
int64 schema_ver = 6;
// Used for partition table scan
repeated TableRegions table_regions = 7;
string log_id = 8;
uint64 connection_id = 9; // This is the session id between a client and tidb
string connection_alias = 10; // This is the session alias between a client and tidb
}
message BatchResponse {
bytes data = 1 [(gogoproto.customtype) = "github.com/pingcap/kvproto/pkg/sharedbytes.SharedBytes", (gogoproto.nullable) = false];
string other_error = 2;
kvrpcpb.ExecDetails exec_details = 3;
repeated metapb.Region retry_regions = 4;
}
message StoreBatchTask {
uint64 region_id = 1;
metapb.RegionEpoch region_epoch = 2;
metapb.Peer peer = 3;
repeated KeyRange ranges = 4;
uint64 task_id = 5;
}
message StoreBatchTaskResponse {
bytes data = 1 [(gogoproto.customtype) = "github.com/pingcap/kvproto/pkg/sharedbytes.SharedBytes", (gogoproto.nullable) = false];
errorpb.Error region_error = 2;
kvrpcpb.LockInfo locked = 3;
string other_error = 4;
uint64 task_id = 5;
kvrpcpb.ExecDetailsV2 exec_details_v2 = 6;
}