Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> [02/12] DRILL-233: Move protobuf IDLs to a separate module and check in the compile Java sources


Copy link to this message
-
[02/12] DRILL-233: Move protobuf IDLs to a separate module and check in the compile Java sources
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/07c6c21d/protocol/src/main/protobuf/Coordination.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/Coordination.proto b/protocol/src/main/protobuf/Coordination.proto
new file mode 100644
index 0000000..5cc5cab
--- /dev/null
+++ b/protocol/src/main/protobuf/Coordination.proto
@@ -0,0 +1,26 @@
+package exec;
+
+option java_package = "org.apache.drill.exec.proto";
+option java_outer_classname = "CoordinationProtos";
+option optimize_for = SPEED;
+
+message DrillbitEndpoint{
+  optional string address = 1;
+  optional int32 user_port = 2;
+  optional int32 bit_port = 3;
+  optional Roles roles = 4;
+}
+
+message DrillServiceInstance{
+  optional string id = 1;
+  optional int64 registrationTimeUTC = 2;
+  optional DrillbitEndpoint endpoint = 3;
+}
+
+message Roles{
+ optional bool sql_query = 1 [default = true];
+ optional bool logical_plan = 2 [default = true];
+ optional bool physical_plan = 3 [default = true];
+ optional bool java_executor = 4 [default = true];
+ optional bool distributed_cache = 5 [default = true];
+}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/07c6c21d/protocol/src/main/protobuf/ExecutionProtos.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/ExecutionProtos.proto b/protocol/src/main/protobuf/ExecutionProtos.proto
new file mode 100644
index 0000000..7501d7c
--- /dev/null
+++ b/protocol/src/main/protobuf/ExecutionProtos.proto
@@ -0,0 +1,98 @@
+package exec.bit;
+
+option java_package = "org.apache.drill.exec.proto";
+option java_outer_classname = "ExecProtos";
+option optimize_for = SPEED;
+
+import "Coordination.proto";
+import "UserBitShared.proto";
+
+
+
+////// UserToBit RPC ///////
+enum RpcType {
+    HANDSHAKE = 0;
+    ACK = 1;
+    GOODBYE = 2;
+    
+    // bit requests
+    REQ_INIATILIZE_FRAGMENT = 3; // Returns Handle
+    REQ_RECORD_BATCH = 4; // send record batch overview, returns Ack
+    
+    REQ_CANCEL_FRAGMENT = 6; // send a cancellation message for a fragment, returns Ack
+ REQ_FRAGMENT_STATUS = 7; // get a fragment status, returns FragmentStatus
+ REQ_BIT_STATUS = 8; // get bit status.
+    
+    // bit responses
+    RESP_FRAGMENT_HANDLE = 9;
+    RESP_FRAGMENT_STATUS = 10;
+ RESP_BIT_STATUS = 11;
+}
+
+
+message BitHandshake{
+ optional int32 rpc_version = 1;
+ optional DrillbitEndpoint endpoint = 2;
+}
+
+message BitBatchChunk {}
+
+message BitStatus {
+ repeated FragmentStatus fragment_status = 1;
+}
+
+message FragmentStatus {
+
+ enum FragmentState {
+  SENDING = 0;
+  AWAITING_ALLOCATION = 1;
+  RUNNING = 2;
+  FINISHED = 3;
+  CANCELLED = 4;
+  FAILED = 5;
+ }
+
+ optional int64 memory_use = 1;
+ optional int64 batches_completed = 2;
+ optional int64 records_completed = 3;
+ optional int32 estimated_completion_percentage = 4;
+ optional FragmentState state = 5;
+ optional int64 data_processed = 6;
+
+ optional FragmentHandle handle = 7;
+ optional exec.shared.DrillPBError error = 8;
+ optional int64 running_time = 9;
+}
+
+message FragmentRecordBatch{
+ optional FragmentHandle handle = 1;
+ optional int32 sending_major_fragment_id = 2;
+ optional int32 sending_minor_fragment_id = 3;
+ optional exec.shared.RecordBatchDef def = 4;
+ optional bool isLastBatch = 5;
+}
+
+message PlanFragment {
+ optional FragmentHandle handle = 1;
+ optional float network_cost = 4;
+ optional float cpu_cost = 5;
+ optional float disk_cost = 6;
+ optional float memory_cost = 7;
+ optional string fragment_json = 8;
+ optional DrillbitEndpoint assignment = 10;
+ optional bool leaf_fragment = 9;
+ optional DrillbitEndpoint foreman = 11;
+
+}
+
+message FragmentHandle {
+ optional exec.shared.QueryId query_id = 1;
+ optional int32 major_fragment_id = 2;
+ optional int32 minor_fragment_id = 3;
+}
+
+message WorkQueueStatus{
+ optional DrillbitEndpoint endpoint = 1;
+ optional int32 queue_length = 2;
+ optional int64 report_time = 3;
+}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/07c6c21d/protocol/src/main/protobuf/GeneralRPC.proto
diff --git a/protocol/src/main/protobuf/GeneralRPC.proto b/protocol/src/main/protobuf/GeneralRPC.proto
new file mode 100644
index 0000000..48011bf
+++ b/protocol/src/main/protobuf/GeneralRPC.proto
@@ -0,0 +1,39 @@
+package exec.rpc;
+
+option java_package = "org.apache.drill.exec.proto";
+option java_outer_classname = "GeneralRPCProtos";
+option optimize_for = SPEED;
+
+import "Coordination.proto";
+
+message Ack{
+ optional bool ok = 1;
+}
+
+enum RpcMode {
+  REQUEST = 0;
+  RESPONSE = 1;
+  RESPONSE_FAILURE = 2;
+}
+
+message RpcHeader{
+ optional RpcMode mode = 1;
+ optional int32 coordination_id = 2; // reusable coordination identifier.  Sender defines.  Server returns on return.  Irrelevant for purely single direction rpc.
+ optional int32 rpc_type = 3; // a rpc mode specific rpc type.
+}
+
+message CompleteRpcMessage {
+    optional RpcHeader header = 1; // required
+    optional bytes protobuf_body = 2; // required
+    optional bytes raw_body = 3; // optional
+}
+
+// Class to be used when an unexpected exception occurs while a rpc call is being evaluated.
+message RpcFailure {
+  optional int64 error_id = 1; // for server trackback.
+  optional int32 error_code = 2; // system defined error code.
+  optional string short_error = 3;
+  optional string long_error = 4;
+}
+
+

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/07c6c21d/protocol/src/main/protobuf/SchemaDef.proto
diff --git a/protocol/src/main/protobuf/SchemaDef.proto b/protocol/src/main/protobuf/SchemaDef.proto
new file mode 100644
index 0000000..2d6575b
+++ b/protocol/src/main/protobuf/SchemaDef.proto
@@ -0,0 +1,31 @@
+package exec;
+
+option java_package = "org.apache.drill.exec.proto";
+option java_outer_classname = "SchemaDefProtos";
+option optimize_for = SPEED;
+
+import "Types.proto";
+
+
+enum ValueMode {
+ VALUE_VECT