Updated Branches: refs/heads/master db0203696 -> 36a7637f2
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java ---------------------------------------------------------------------- diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java b/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java index 60dd6fd..1b6d242 100644 --- a/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java +++ b/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java @@ -25,6 +25,97 @@ public final class UserBitShared { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } + /** + * Protobuf enum {@code exec.shared.RpcChannel} + */ + public enum RpcChannel + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>BIT_CONTROL = 0;</code> + */ + BIT_CONTROL(0, 0), + /** + * <code>BIT_DATA = 1;</code> + */ + BIT_DATA(1, 1), + /** + * <code>USER = 2;</code> + */ + USER(2, 2), + ; + + /** + * <code>BIT_CONTROL = 0;</code> + */ + public static final int BIT_CONTROL_VALUE = 0; + /** + * <code>BIT_DATA = 1;</code> + */ + public static final int BIT_DATA_VALUE = 1; + /** + * <code>USER = 2;</code> + */ + public static final int USER_VALUE = 2; + + + public final int getNumber() { return value; } + + public static RpcChannel valueOf(int value) { + switch (value) { + case 0: return BIT_CONTROL; + case 1: return BIT_DATA; + case 2: return USER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<RpcChannel> + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap<RpcChannel> + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<RpcChannel>() { + public RpcChannel findValueByNumber(int number) { + return RpcChannel.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.apache.drill.exec.proto.UserBitShared.getDescriptor().getEnumTypes().get(0); + } + + private static final RpcChannel[] VALUES = values(); + + public static RpcChannel valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private RpcChannel(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:exec.shared.RpcChannel) + } + public interface QueryIdOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -2563,315 +2654,6 @@ public final class UserBitShared { // @@protoc_insertion_point(class_scope:exec.shared.ParsingError) } - public interface RecordBatchOrBuilder - extends com.google.protobuf.MessageOrBuilder { - } - /** - * Protobuf type {@code exec.shared.RecordBatch} - */ - public static final class RecordBatch extends - com.google.protobuf.GeneratedMessage - implements RecordBatchOrBuilder { - // Use RecordBatch.newBuilder() to construct. - private RecordBatch(com.google.protobuf.GeneratedMessage.Builder<?> builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private RecordBatch(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } - - private static final RecordBatch defaultInstance; - public static RecordBatch getDefaultInstance() { - return defaultInstance; - } - - public RecordBatch getDefaultInstanceForType() { - return defaultInstance; - } - - private final com.google.protobuf.UnknownFieldSet unknownFields; - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecordBatch( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - initFields(); - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.apache.drill.exec.proto.UserBitShared.internal_static_exec_shared_RecordBatch_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.apache.drill.exec.proto.UserBitShared.internal_static_exec_shared_RecordBatch_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.apache.drill.exec.proto.UserBitShared.RecordBatch.class, org.apache.drill.exec.proto.UserBitShared.RecordBatch.Builder.class); - } - - public static com.google.protobuf.Parser<RecordBatch> PARSER = - new com.google.protobuf.AbstractParser<RecordBatch>() { - public RecordBatch parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecordBatch(input, extensionRegistry); - } - }; - - @java.lang.Override - public com.google.protobuf.Parser<RecordBatch> getParserForType() { - return PARSER; - } - - private void initFields() { - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.apache.drill.exec.proto.UserBitShared.RecordBatch parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.apache.drill.exec.proto.UserBitShared.RecordBatch prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code exec.shared.RecordBatch} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder<Builder> - implements org.apache.drill.exec.proto.UserBitShared.RecordBatchOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.apache.drill.exec.proto.UserBitShared.internal_static_exec_shared_RecordBatch_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.apache.drill.exec.proto.UserBitShared.internal_static_exec_shared_RecordBatch_fieldAccessorTable - .ensureFieldAccessorsInitialized( - org.apache.drill.exec.proto.UserBitShared.RecordBatch.class, org.apache.drill.exec.proto.UserBitShared.RecordBatch.Builder.class); - } - - // Construct using org.apache.drill.exec.proto.UserBitShared.RecordBatch.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.apache.drill.exec.proto.UserBitShared.internal_static_exec_shared_RecordBatch_descriptor; - } - - public org.apache.drill.exec.proto.UserBitShared.RecordBatch getDefaultInstanceForType() { - return org.apache.drill.exec.proto.UserBitShared.RecordBatch.getDefaultInstance(); - } - - public org.apache.drill.exec.proto.UserBitShared.RecordBatch build() { - org.apache.drill.exec.proto.UserBitShared.RecordBatch result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.apache.drill.exec.proto.UserBitShared.RecordBatch buildPartial() { - org.apache.drill.exec.proto.UserBitShared.RecordBatch result = new org.apache.drill.exec.proto.UserBitShared.RecordBatch(this); - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.apache.drill.exec.proto.UserBitShared.RecordBatch) { - return mergeFrom((org.apache.drill.exec.proto.UserBitShared.RecordBatch)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.apache.drill.exec.proto.UserBitShared.RecordBatch other) { - if (other == org.apache.drill.exec.proto.UserBitShared.RecordBatch.getDefaultInstance()) return this; - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.apache.drill.exec.proto.UserBitShared.RecordBatch parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.apache.drill.exec.proto.UserBitShared.RecordBatch) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - // @@protoc_insertion_point(builder_scope:exec.shared.RecordBatch) - } - - static { - defaultInstance = new RecordBatch(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:exec.shared.RecordBatch) - } - public interface RecordBatchDefOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -4952,11 +4734,6 @@ public final class UserBitShared { com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_exec_shared_ParsingError_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor - internal_static_exec_shared_RecordBatch_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_exec_shared_RecordBatch_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor internal_static_exec_shared_RecordBatchDef_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -4984,14 +4761,15 @@ public final class UserBitShared { "ror\030\005 \003(\0132\031.exec.shared.ParsingError\"\\\n\014" + "ParsingError\022\024\n\014start_column\030\002 \001(\005\022\021\n\tst" + "art_row\030\003 \001(\005\022\022\n\nend_column\030\004 \001(\005\022\017\n\007end" + - "_row\030\005 \001(\005\"\r\n\013RecordBatch\"p\n\016RecordBatch", - "Def\022)\n\005field\030\001 \003(\0132\032.exec.shared.FieldMe" + - "tadata\022\024\n\014record_count\030\002 \001(\005\022\035\n\025is_selec" + - "tion_vector_2\030\003 \001(\010\"\261\001\n\rFieldMetadata\022\033\n" + - "\003def\030\001 \001(\0132\016.exec.FieldDef\022\023\n\013value_coun" + - "t\030\002 \001(\005\022\027\n\017var_byte_length\030\003 \001(\005\022\023\n\013grou" + - "p_count\030\004 \001(\005\022\025\n\rbuffer_length\030\005 \001(\005\022)\n\005" + - "child\030\006 \003(\0132\032.exec.shared.FieldMetadataB" + + "_row\030\005 \001(\005\"p\n\016RecordBatchDef\022)\n\005field\030\001 ", + "\003(\0132\032.exec.shared.FieldMetadata\022\024\n\014recor" + + "d_count\030\002 \001(\005\022\035\n\025is_selection_vector_2\030\003" + + " \001(\010\"\261\001\n\rFieldMetadata\022\033\n\003def\030\001 \001(\0132\016.ex" + + "ec.FieldDef\022\023\n\013value_count\030\002 \001(\005\022\027\n\017var_" + + "byte_length\030\003 \001(\005\022\023\n\013group_count\030\004 \001(\005\022\025" + + "\n\rbuffer_length\030\005 \001(\005\022)\n\005child\030\006 \003(\0132\032.e" + + "xec.shared.FieldMetadata*5\n\nRpcChannel\022\017" + + "\n\013BIT_CONTROL\020\000\022\014\n\010BIT_DATA\020\001\022\010\n\004USER\020\002B" + ".\n\033org.apache.drill.exec.protoB\rUserBitS" + "haredH\001" }; @@ -5018,20 +4796,14 @@ public final class UserBitShared { com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_exec_shared_ParsingError_descriptor, new java.lang.String[] { "StartColumn", "StartRow", "EndColumn", "EndRow", }); - internal_static_exec_shared_RecordBatch_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_exec_shared_RecordBatch_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_exec_shared_RecordBatch_descriptor, - new java.lang.String[] { }); internal_static_exec_shared_RecordBatchDef_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(3); internal_static_exec_shared_RecordBatchDef_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_exec_shared_RecordBatchDef_descriptor, new java.lang.String[] { "Field", "RecordCount", "IsSelectionVector2", }); internal_static_exec_shared_FieldMetadata_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(4); internal_static_exec_shared_FieldMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_exec_shared_FieldMetadata_descriptor, http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java ---------------------------------------------------------------------- diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java b/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java index e505204..8d4fc60 100644 --- a/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java +++ b/protocol/src/main/java/org/apache/drill/exec/proto/UserProtos.java @@ -356,6 +356,16 @@ public final class UserProtos { public interface UserToBitHandshakeOrBuilder extends com.google.protobuf.MessageOrBuilder { + // optional .exec.shared.RpcChannel channel = 1 [default = USER]; + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + boolean hasChannel(); + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel(); + // optional bool support_listening = 2; /** * <code>optional bool support_listening = 2;</code> @@ -427,13 +437,24 @@ public final class UserProtos { } break; } + case 8: { + int rawValue = input.readEnum(); + org.apache.drill.exec.proto.UserBitShared.RpcChannel value = org.apache.drill.exec.proto.UserBitShared.RpcChannel.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + channel_ = value; + } + break; + } case 16: { - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; supportListening_ = input.readBool(); break; } case 24: { - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; rpcVersion_ = input.readInt32(); break; } @@ -477,6 +498,22 @@ public final class UserProtos { } private int bitField0_; + // optional .exec.shared.RpcChannel channel = 1 [default = USER]; + public static final int CHANNEL_FIELD_NUMBER = 1; + private org.apache.drill.exec.proto.UserBitShared.RpcChannel channel_; + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + public boolean hasChannel() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + public org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel() { + return channel_; + } + // optional bool support_listening = 2; public static final int SUPPORT_LISTENING_FIELD_NUMBER = 2; private boolean supportListening_; @@ -484,7 +521,7 @@ public final class UserProtos { * <code>optional bool support_listening = 2;</code> */ public boolean hasSupportListening() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>optional bool support_listening = 2;</code> @@ -500,7 +537,7 @@ public final class UserProtos { * <code>optional int32 rpc_version = 3;</code> */ public boolean hasRpcVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>optional int32 rpc_version = 3;</code> @@ -510,6 +547,7 @@ public final class UserProtos { } private void initFields() { + channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.USER; supportListening_ = false; rpcVersion_ = 0; } @@ -526,9 +564,12 @@ public final class UserProtos { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBool(2, supportListening_); + output.writeEnum(1, channel_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBool(2, supportListening_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeInt32(3, rpcVersion_); } getUnknownFields().writeTo(output); @@ -542,10 +583,14 @@ public final class UserProtos { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, supportListening_); + .computeEnumSize(1, channel_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, supportListening_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, rpcVersion_); } size += getUnknownFields().getSerializedSize(); @@ -664,10 +709,12 @@ public final class UserProtos { public Builder clear() { super.clear(); - supportListening_ = false; + channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.USER; bitField0_ = (bitField0_ & ~0x00000001); - rpcVersion_ = 0; + supportListening_ = false; bitField0_ = (bitField0_ & ~0x00000002); + rpcVersion_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -699,10 +746,14 @@ public final class UserProtos { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.supportListening_ = supportListening_; + result.channel_ = channel_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } + result.supportListening_ = supportListening_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } result.rpcVersion_ = rpcVersion_; result.bitField0_ = to_bitField0_; onBuilt(); @@ -720,6 +771,9 @@ public final class UserProtos { public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.UserToBitHandshake other) { if (other == org.apache.drill.exec.proto.UserProtos.UserToBitHandshake.getDefaultInstance()) return this; + if (other.hasChannel()) { + setChannel(other.getChannel()); + } if (other.hasSupportListening()) { setSupportListening(other.getSupportListening()); } @@ -753,13 +807,49 @@ public final class UserProtos { } private int bitField0_; + // optional .exec.shared.RpcChannel channel = 1 [default = USER]; + private org.apache.drill.exec.proto.UserBitShared.RpcChannel channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.USER; + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + public boolean hasChannel() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + public org.apache.drill.exec.proto.UserBitShared.RpcChannel getChannel() { + return channel_; + } + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + public Builder setChannel(org.apache.drill.exec.proto.UserBitShared.RpcChannel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + channel_ = value; + onChanged(); + return this; + } + /** + * <code>optional .exec.shared.RpcChannel channel = 1 [default = USER];</code> + */ + public Builder clearChannel() { + bitField0_ = (bitField0_ & ~0x00000001); + channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.USER; + onChanged(); + return this; + } + // optional bool support_listening = 2; private boolean supportListening_ ; /** * <code>optional bool support_listening = 2;</code> */ public boolean hasSupportListening() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000002) == 0x00000002); } /** * <code>optional bool support_listening = 2;</code> @@ -771,7 +861,7 @@ public final class UserProtos { * <code>optional bool support_listening = 2;</code> */ public Builder setSupportListening(boolean value) { - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; supportListening_ = value; onChanged(); return this; @@ -780,7 +870,7 @@ public final class UserProtos { * <code>optional bool support_listening = 2;</code> */ public Builder clearSupportListening() { - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); supportListening_ = false; onChanged(); return this; @@ -792,7 +882,7 @@ public final class UserProtos { * <code>optional int32 rpc_version = 3;</code> */ public boolean hasRpcVersion() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000004) == 0x00000004); } /** * <code>optional int32 rpc_version = 3;</code> @@ -804,7 +894,7 @@ public final class UserProtos { * <code>optional int32 rpc_version = 3;</code> */ public Builder setRpcVersion(int value) { - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000004; rpcVersion_ = value; onChanged(); return this; @@ -813,7 +903,7 @@ public final class UserProtos { * <code>optional int32 rpc_version = 3;</code> */ public Builder clearRpcVersion() { - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000004); rpcVersion_ = 0; onChanged(); return this; @@ -5099,35 +5189,36 @@ public final class UserProtos { static { java.lang.String[] descriptorData = { "\n\nUser.proto\022\texec.user\032\017SchemaDef.proto" + - "\032\023UserBitShared.proto\"D\n\022UserToBitHandsh" + - "ake\022\031\n\021support_listening\030\002 \001(\010\022\023\n\013rpc_ve" + - "rsion\030\003 \001(\005\"S\n\016RequestResults\022&\n\010query_i" + - "d\030\001 \001(\0132\024.exec.shared.QueryId\022\031\n\021maximum" + - "_responses\030\002 \001(\005\"o\n\010RunQuery\0221\n\014results_" + - "mode\030\001 \001(\0162\033.exec.user.QueryResultsMode\022" + - "\"\n\004type\030\002 \001(\0162\024.exec.user.QueryType\022\014\n\004p" + - "lan\030\003 \001(\t\")\n\022BitToUserHandshake\022\023\n\013rpc_v" + - "ersion\030\002 \001(\005\"7\n\nNodeStatus\022\017\n\007node_id\030\001 ", - "\001(\005\022\030\n\020memory_footprint\030\002 \001(\003\"\331\003\n\013QueryR" + - "esult\0226\n\013query_state\030\001 \001(\0162!.exec.user.Q" + - "ueryResult.QueryState\022&\n\010query_id\030\002 \001(\0132" + - "\024.exec.shared.QueryId\022\025\n\ris_last_chunk\030\003" + - " \001(\010\022\021\n\trow_count\030\004 \001(\005\022\024\n\014records_scan\030" + - "\005 \001(\003\022\025\n\rrecords_error\030\006 \001(\003\022\027\n\017submissi" + - "on_time\030\007 \001(\003\022*\n\013node_status\030\010 \003(\0132\025.exe" + - "c.user.NodeStatus\022(\n\005error\030\t \003(\0132\031.exec." + - "shared.DrillPBError\022(\n\003def\030\n \001(\0132\033.exec." + - "shared.RecordBatchDef\022\026\n\016schema_changed\030", - "\013 \001(\010\"b\n\nQueryState\022\013\n\007PENDING\020\000\022\013\n\007RUNN" + - "ING\020\001\022\r\n\tCOMPLETED\020\002\022\014\n\010CANCELED\020\003\022\n\n\006FA" + - "ILED\020\004\022\021\n\rUNKNOWN_QUERY\020\005*\210\001\n\007RpcType\022\r\n" + - "\tHANDSHAKE\020\000\022\007\n\003ACK\020\001\022\013\n\007GOODBYE\020\002\022\r\n\tRU" + - "N_QUERY\020\003\022\020\n\014CANCEL_QUERY\020\004\022\023\n\017REQUEST_R" + - "ESULTS\020\005\022\020\n\014QUERY_RESULT\020\006\022\020\n\014QUERY_HAND" + - "LE\020\007*/\n\tQueryType\022\007\n\003SQL\020\001\022\013\n\007LOGICAL\020\002\022" + - "\014\n\010PHYSICAL\020\003*#\n\020QueryResultsMode\022\017\n\013STR" + - "EAM_FULL\020\001B+\n\033org.apache.drill.exec.prot" + - "oB\nUserProtosH\001" + "\032\023UserBitShared.proto\"t\n\022UserToBitHandsh" + + "ake\022.\n\007channel\030\001 \001(\0162\027.exec.shared.RpcCh" + + "annel:\004USER\022\031\n\021support_listening\030\002 \001(\010\022\023" + + "\n\013rpc_version\030\003 \001(\005\"S\n\016RequestResults\022&\n" + + "\010query_id\030\001 \001(\0132\024.exec.shared.QueryId\022\031\n" + + "\021maximum_responses\030\002 \001(\005\"o\n\010RunQuery\0221\n\014" + + "results_mode\030\001 \001(\0162\033.exec.user.QueryResu" + + "ltsMode\022\"\n\004type\030\002 \001(\0162\024.exec.user.QueryT" + + "ype\022\014\n\004plan\030\003 \001(\t\")\n\022BitToUserHandshake\022", + "\023\n\013rpc_version\030\002 \001(\005\"7\n\nNodeStatus\022\017\n\007no" + + "de_id\030\001 \001(\005\022\030\n\020memory_footprint\030\002 \001(\003\"\331\003" + + "\n\013QueryResult\0226\n\013query_state\030\001 \001(\0162!.exe" + + "c.user.QueryResult.QueryState\022&\n\010query_i" + + "d\030\002 \001(\0132\024.exec.shared.QueryId\022\025\n\ris_last" + + "_chunk\030\003 \001(\010\022\021\n\trow_count\030\004 \001(\005\022\024\n\014recor" + + "ds_scan\030\005 \001(\003\022\025\n\rrecords_error\030\006 \001(\003\022\027\n\017" + + "submission_time\030\007 \001(\003\022*\n\013node_status\030\010 \003" + + "(\0132\025.exec.user.NodeStatus\022(\n\005error\030\t \003(\013" + + "2\031.exec.shared.DrillPBError\022(\n\003def\030\n \001(\013", + "2\033.exec.shared.RecordBatchDef\022\026\n\016schema_" + + "changed\030\013 \001(\010\"b\n\nQueryState\022\013\n\007PENDING\020\000" + + "\022\013\n\007RUNNING\020\001\022\r\n\tCOMPLETED\020\002\022\014\n\010CANCELED" + + "\020\003\022\n\n\006FAILED\020\004\022\021\n\rUNKNOWN_QUERY\020\005*\210\001\n\007Rp" + + "cType\022\r\n\tHANDSHAKE\020\000\022\007\n\003ACK\020\001\022\013\n\007GOODBYE" + + "\020\002\022\r\n\tRUN_QUERY\020\003\022\020\n\014CANCEL_QUERY\020\004\022\023\n\017R" + + "EQUEST_RESULTS\020\005\022\020\n\014QUERY_RESULT\020\006\022\020\n\014QU" + + "ERY_HANDLE\020\007*/\n\tQueryType\022\007\n\003SQL\020\001\022\013\n\007LO" + + "GICAL\020\002\022\014\n\010PHYSICAL\020\003*#\n\020QueryResultsMod" + + "e\022\017\n\013STREAM_FULL\020\001B+\n\033org.apache.drill.e", + "xec.protoB\nUserProtosH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -5139,7 +5230,7 @@ public final class UserProtos { internal_static_exec_user_UserToBitHandshake_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_exec_user_UserToBitHandshake_descriptor, - new java.lang.String[] { "SupportListening", "RpcVersion", }); + new java.lang.String[] { "Channel", "SupportListening", "RpcVersion", }); internal_static_exec_user_RequestResults_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_exec_user_RequestResults_fieldAccessorTable = new http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/java/org/apache/drill/exec/proto/helper/QueryIdHelper.java ---------------------------------------------------------------------- diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/helper/QueryIdHelper.java b/protocol/src/main/java/org/apache/drill/exec/proto/helper/QueryIdHelper.java deleted file mode 100644 index 749b3d5..0000000 --- a/protocol/src/main/java/org/apache/drill/exec/proto/helper/QueryIdHelper.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.drill.exec.proto.helper; - -import java.util.UUID; -import org.apache.drill.exec.proto.UserBitShared.QueryId; - -/* Helper class around the QueryId protobuf */ -public class QueryIdHelper { - - /* Generate a UUID from the two parts of the queryid */ - public static String getQueryId(QueryId queryId) - { - return (new UUID(queryId.getPart1(), queryId.getPart2())).toString(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/protobuf/BitControl.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/BitControl.proto b/protocol/src/main/protobuf/BitControl.proto new file mode 100644 index 0000000..d96f7cf --- /dev/null +++ b/protocol/src/main/protobuf/BitControl.proto @@ -0,0 +1,83 @@ +package exec.bit.control; + +option java_package = "org.apache.drill.exec.proto"; +option java_outer_classname = "BitControl"; +option optimize_for = SPEED; + +import "ExecutionProtos.proto"; +import "Coordination.proto"; +import "UserBitShared.proto"; + + +////// BitControl RPC /////// +enum RpcType { + HANDSHAKE = 0; + ACK = 1; + GOODBYE = 2; + + // bit requests + 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_BIT_STATUS = 8; // get bit status. + + // bit responses + RESP_FRAGMENT_HANDLE = 9; + RESP_FRAGMENT_STATUS = 10; + RESP_BIT_STATUS = 11; +} + + +message BitControlHandshake{ + optional int32 rpc_version = 1; + optional exec.shared.RpcChannel channel = 2 [default = BIT_CONTROL]; + optional DrillbitEndpoint endpoint = 3; +} + +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 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; + optional int64 mem_initial = 12 [default = 20000000]; // 20 megs + optional int64 mem_max = 13 [default = 20000000000]; // 20 gigs +} + +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/a0eabf63/protocol/src/main/protobuf/BitData.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/BitData.proto b/protocol/src/main/protobuf/BitData.proto new file mode 100644 index 0000000..5356398 --- /dev/null +++ b/protocol/src/main/protobuf/BitData.proto @@ -0,0 +1,34 @@ +package exec.bit.data; + +option java_package = "org.apache.drill.exec.proto"; +option java_outer_classname = "BitData"; +option optimize_for = SPEED; + +import "ExecutionProtos.proto"; +import "Coordination.proto"; +import "UserBitShared.proto"; + +enum RpcType { + HANDSHAKE = 0; + ACK = 1; + GOODBYE = 2; + REQ_RECORD_BATCH = 3; // send record batch, returns Ack +} + +message BitClientHandshake{ + optional int32 rpc_version = 1; + optional exec.shared.RpcChannel channel = 2 [default = BIT_DATA]; + optional FragmentHandle handle = 3; +} + +message BitServerHandshake{ + optional int32 rpc_version = 1; +} + +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; +} http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/protobuf/Coordination.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/Coordination.proto b/protocol/src/main/protobuf/Coordination.proto index 5cc5cab..28c99d6 100644 --- a/protocol/src/main/protobuf/Coordination.proto +++ b/protocol/src/main/protobuf/Coordination.proto @@ -7,8 +7,9 @@ option optimize_for = SPEED; message DrillbitEndpoint{ optional string address = 1; optional int32 user_port = 2; - optional int32 bit_port = 3; - optional Roles roles = 4; + optional int32 control_port = 3; + optional int32 data_port = 4; + optional Roles roles = 5; } message DrillServiceInstance{ http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/protobuf/ExecutionProtos.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/ExecutionProtos.proto b/protocol/src/main/protobuf/ExecutionProtos.proto index 7501d7c..8ad8c47 100644 --- a/protocol/src/main/protobuf/ExecutionProtos.proto +++ b/protocol/src/main/protobuf/ExecutionProtos.proto @@ -7,92 +7,9 @@ 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/a0eabf63/protocol/src/main/protobuf/User.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/User.proto b/protocol/src/main/protobuf/User.proto index cbf5b4c..0c1e588 100644 --- a/protocol/src/main/protobuf/User.proto +++ b/protocol/src/main/protobuf/User.proto @@ -26,8 +26,9 @@ enum RpcType { } message UserToBitHandshake { - optional bool support_listening = 2; - optional int32 rpc_version = 3; + optional exec.shared.RpcChannel channel = 1 [default = USER]; + optional bool support_listening = 2; + optional int32 rpc_version = 3; } message RequestResults { http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/protocol/src/main/protobuf/UserBitShared.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/UserBitShared.proto b/protocol/src/main/protobuf/UserBitShared.proto index 0d98797..d75a7f9 100644 --- a/protocol/src/main/protobuf/UserBitShared.proto +++ b/protocol/src/main/protobuf/UserBitShared.proto @@ -7,35 +7,36 @@ option optimize_for = SPEED; import "Coordination.proto"; import "SchemaDef.proto"; +enum RpcChannel { + BIT_CONTROL = 0; + BIT_DATA = 1; + USER = 2; +} + message QueryId { - optional sfixed64 part1 = 1; - optional sfixed64 part2 = 2; + optional sfixed64 part1 = 1; + optional sfixed64 part2 = 2; } message DrillPBError{ - optional string error_id = 1; // for debug tracing purposes - optional DrillbitEndpoint endpoint = 2; - optional int32 error_type = 3; - optional string message = 4; - repeated ParsingError parsing_error = 5; //optional, used when providing location of error within a piece of text. + optional string error_id = 1; // for debug tracing purposes + optional DrillbitEndpoint endpoint = 2; + optional int32 error_type = 3; + optional string message = 4; + repeated ParsingError parsing_error = 5; //optional, used when providing location of error within a piece of text. } message ParsingError{ - optional int32 start_column = 2; - optional int32 start_row = 3; - optional int32 end_column = 4; - optional int32 end_row = 5; -} - -message RecordBatch{ - + optional int32 start_column = 2; + optional int32 start_row = 3; + optional int32 end_column = 4; + optional int32 end_row = 5; } message RecordBatchDef { repeated FieldMetadata field = 1; optional int32 record_count = 2; - optional bool is_selection_vector_2 = 3; - + optional bool is_selection_vector_2 = 3; } message FieldMetadata { http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a0eabf63/sqlparser/src/main/java/org/apache/drill/optiq/DrillOptiq.java ---------------------------------------------------------------------- diff --git a/sqlparser/src/main/java/org/apache/drill/optiq/DrillOptiq.java b/sqlparser/src/main/java/org/apache/drill/optiq/DrillOptiq.java index 1245cfe..1897151 100644 --- a/sqlparser/src/main/java/org/apache/drill/optiq/DrillOptiq.java +++ b/sqlparser/src/main/java/org/apache/drill/optiq/DrillOptiq.java @@ -20,7 +20,7 @@ package org.apache.drill.optiq; import net.hydromatic.linq4j.Ord; import org.apache.drill.exec.client.DrillClient; -import org.apache.drill.exec.work.FragmentRunnerListener; +import org.apache.drill.exec.work.fragment.StatusReporter; import org.eigenbase.rel.RelNode; import org.eigenbase.relopt.RelOptPlanner; import org.eigenbase.reltype.RelDataTypeField;
