File: mpp.proto

package info (click to toggle)
golang-github-pingcap-kvproto 6.1.0~alpha-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,040 kB
  • sloc: sh: 111; makefile: 34
file content (74 lines) | stat: -rw-r--r-- 2,125 bytes parent folder | download
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
syntax = "proto3";
package mpp;

import "gogoproto/gogo.proto";
import "coprocessor.proto";
import "metapb.proto";

option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;

option java_package = "org.tikv.kvproto";

// TaskMeta contains meta of a mpp plan, including query's ts and task address.
message TaskMeta {
	uint64 start_ts = 1; // start ts of a query
	int64 task_id = 2; // if task id is -1 , it indicates a tidb task.
	int64 partition_id = 3; // Only used for hash partition
	string address = 4; // target address of this task.
}

message IsAliveRequest {
}

message IsAliveResponse {
        bool available = 1;
}

// Dipsatch the task request to different tiflash servers.
message DispatchTaskRequest {
	TaskMeta meta = 1;
	bytes encoded_plan = 2;
	int64 timeout = 3;
        repeated coprocessor.RegionInfo regions = 4; 
	// If this task contains table scan, we still need their region info.
	int64 schema_ver = 5;
	// Used for partition table scan
	repeated coprocessor.TableRegions table_regions = 6;
}

// Get response of DispatchTaskRequest.
message DispatchTaskResponse {
	Error error = 1;
	repeated metapb.Region retry_regions = 2;
}

// CancelTaskRequest closes the execution of a task.
message CancelTaskRequest {
	TaskMeta meta = 1;
	Error error = 2;
}

message CancelTaskResponse {
	Error error = 1;
}

// build connection between different tasks. Data is sent by the tasks that are closer to the data sources.
message EstablishMPPConnectionRequest {
        TaskMeta sender_meta = 1; // node closer to the source
	TaskMeta receiver_meta = 2; // node closer to the tidb mpp gather.
}

// when TiFlash sends data to TiDB, Data packets wrap tipb.SelectResponse, i.e., serialize tipb.SelectResponse into data;
// when TiFlash sends data to TiFlash, data blocks are serialized into chunks, and the execution_summaries in tipb.SelectResponse are serialized into data only for the last packet.
message MPPDataPacket {
        bytes data = 1;
	Error error = 2;
	repeated bytes chunks = 3;
}

message Error {
	int32 code = 1;
	string msg = 2;
}