http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2dec152b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java ---------------------------------------------------------------------- diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java index f603460..235b6e6 100644 --- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java +++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java @@ -55,6 +55,10 @@ public final class QueryProfile implements Externalizable, Message<QueryProfile> private long end; private String query; private String plan; + private DrillbitEndpoint foreman; + private QueryResult.QueryState state; + private int totalFragments; + private int finishedFragments; private List<MajorFragmentProfile> fragmentProfile; public QueryProfile() @@ -142,6 +146,58 @@ public final class QueryProfile implements Externalizable, Message<QueryProfile> return this; } + // foreman + + public DrillbitEndpoint getForeman() + { + return foreman; + } + + public QueryProfile setForeman(DrillbitEndpoint foreman) + { + this.foreman = foreman; + return this; + } + + // state + + public QueryResult.QueryState getState() + { + return state == null ? QueryResult.QueryState.PENDING : state; + } + + public QueryProfile setState(QueryResult.QueryState state) + { + this.state = state; + return this; + } + + // totalFragments + + public int getTotalFragments() + { + return totalFragments; + } + + public QueryProfile setTotalFragments(int totalFragments) + { + this.totalFragments = totalFragments; + return this; + } + + // finishedFragments + + public int getFinishedFragments() + { + return finishedFragments; + } + + public QueryProfile setFinishedFragments(int finishedFragments) + { + this.finishedFragments = finishedFragments; + return this; + } + // fragmentProfile public List<MajorFragmentProfile> getFragmentProfileList() @@ -229,6 +285,19 @@ public final class QueryProfile implements Externalizable, Message<QueryProfile> message.plan = input.readString(); break; case 7: + message.foreman = input.mergeObject(message.foreman, DrillbitEndpoint.getSchema()); + break; + + case 8: + message.state = QueryResult.QueryState.valueOf(input.readEnum()); + break; + case 9: + message.totalFragments = input.readInt32(); + break; + case 10: + message.finishedFragments = input.readInt32(); + break; + case 11: if(message.fragmentProfile == null) message.fragmentProfile = new ArrayList<MajorFragmentProfile>(); message.fragmentProfile.add(input.mergeObject(null, MajorFragmentProfile.getSchema())); @@ -262,12 +331,25 @@ public final class QueryProfile implements Externalizable, Message<QueryProfile> if(message.plan != null) output.writeString(6, message.plan, false); + if(message.foreman != null) + output.writeObject(7, message.foreman, DrillbitEndpoint.getSchema(), false); + + + if(message.state != null) + output.writeEnum(8, message.state.number, false); + + if(message.totalFragments != 0) + output.writeInt32(9, message.totalFragments, false); + + if(message.finishedFragments != 0) + output.writeInt32(10, message.finishedFragments, false); + if(message.fragmentProfile != null) { for(MajorFragmentProfile fragmentProfile : message.fragmentProfile) { if(fragmentProfile != null) - output.writeObject(7, fragmentProfile, MajorFragmentProfile.getSchema(), true); + output.writeObject(11, fragmentProfile, MajorFragmentProfile.getSchema(), true); } } @@ -283,7 +365,11 @@ public final class QueryProfile implements Externalizable, Message<QueryProfile> case 4: return "end"; case 5: return "query"; case 6: return "plan"; - case 7: return "fragmentProfile"; + case 7: return "foreman"; + case 8: return "state"; + case 9: return "totalFragments"; + case 10: return "finishedFragments"; + case 11: return "fragmentProfile"; default: return null; } } @@ -303,7 +389,11 @@ public final class QueryProfile implements Externalizable, Message<QueryProfile> __fieldMap.put("end", 4); __fieldMap.put("query", 5); __fieldMap.put("plan", 6); - __fieldMap.put("fragmentProfile", 7); + __fieldMap.put("foreman", 7); + __fieldMap.put("state", 8); + __fieldMap.put("totalFragments", 9); + __fieldMap.put("finishedFragments", 10); + __fieldMap.put("fragmentProfile", 11); } }
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2dec152b/protocol/src/main/protobuf/BitControl.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/BitControl.proto b/protocol/src/main/protobuf/BitControl.proto index 43037b9..727fdef 100644 --- a/protocol/src/main/protobuf/BitControl.proto +++ b/protocol/src/main/protobuf/BitControl.proto @@ -19,13 +19,15 @@ enum RpcType { REQ_INIATILIZE_FRAGMENT = 3; // Returns Handle REQ_CANCEL_FRAGMENT = 6; // send a cancellation message for a fragment, returns Ack - REQ_FRAGMENT_STATUS = 7; // get a fragment status, returns FragmentStatus + REQ_FRAGMENT_STATUS = 7; // send a fragment status, return Ack REQ_BIT_STATUS = 8; // get bit status. + REQ_QUERY_STATUS = 9; // bit responses - RESP_FRAGMENT_HANDLE = 9; - RESP_FRAGMENT_STATUS = 10; - RESP_BIT_STATUS = 11; + RESP_FRAGMENT_HANDLE = 10; + RESP_FRAGMENT_STATUS = 11; + RESP_BIT_STATUS = 12; + RESP_QUERY_STATUS = 13; } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2dec152b/protocol/src/main/protobuf/User.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/User.proto b/protocol/src/main/protobuf/User.proto index 7809fdc..ea12323 100644 --- a/protocol/src/main/protobuf/User.proto +++ b/protocol/src/main/protobuf/User.proto @@ -70,33 +70,6 @@ message BitToUserHandshake { optional int32 rpc_version = 2; } -message NodeStatus { - optional int32 node_id = 1; - optional int64 memory_footprint = 2; -} - -message QueryResult { - enum QueryState { - PENDING = 0; - RUNNING = 1; - COMPLETED = 2; - CANCELED = 3; - FAILED = 4; - UNKNOWN_QUERY = 5; - } - - optional QueryState query_state = 1; - optional exec.shared.QueryId query_id = 2; - optional bool is_last_chunk = 3; - optional int32 row_count = 4; - optional int64 records_scan = 5; - optional int64 records_error = 6; - optional int64 submission_time = 7; - repeated NodeStatus node_status = 8; - repeated exec.shared.DrillPBError error = 9; - optional exec.shared.RecordBatchDef def = 10; - optional bool schema_changed = 11; -} http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2dec152b/protocol/src/main/protobuf/UserBitShared.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/UserBitShared.proto b/protocol/src/main/protobuf/UserBitShared.proto index a13587a..4bafeb8 100644 --- a/protocol/src/main/protobuf/UserBitShared.proto +++ b/protocol/src/main/protobuf/UserBitShared.proto @@ -73,6 +73,33 @@ message SerializedField { optional int32 buffer_length = 7; } +message NodeStatus { + optional int32 node_id = 1; + optional int64 memory_footprint = 2; +} + +message QueryResult { + enum QueryState { + PENDING = 0; + RUNNING = 1; + COMPLETED = 2; + CANCELED = 3; + FAILED = 4; + UNKNOWN_QUERY = 5; + } + + optional QueryState query_state = 1; + optional QueryId query_id = 2; + optional bool is_last_chunk = 3; + optional int32 row_count = 4; + optional int64 records_scan = 5; + optional int64 records_error = 6; + optional int64 submission_time = 7; + repeated NodeStatus node_status = 8; + repeated DrillPBError error = 9; + optional RecordBatchDef def = 10; + optional bool schema_changed = 11; +} @@ -83,7 +110,11 @@ message QueryProfile { optional int64 end = 4; optional string query = 5; optional string plan = 6; - repeated MajorFragmentProfile fragment_profile = 7; + optional DrillbitEndpoint foreman = 7; + optional QueryResult.QueryState state = 8; + optional int32 total_fragments = 9; + optional int32 finished_fragments = 10; + repeated MajorFragmentProfile fragment_profile = 11; } message MajorFragmentProfile {
