You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ad...@apache.org on 2016/10/19 22:52:53 UTC
[1/3] drill git commit: DRILL-4369: Exchange name and version infos
during handshake
Repository: drill
Updated Branches:
refs/heads/master db4829892 -> 13f21e14b
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/protocol/src/main/java/org/apache/drill/exec/proto/beans/BitToUserHandshake.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/BitToUserHandshake.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/BitToUserHandshake.java
index 20c6de1..dc42289 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/BitToUserHandshake.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/BitToUserHandshake.java
@@ -51,6 +51,7 @@ public final class BitToUserHandshake implements Externalizable, Message<BitToUs
private HandshakeStatus status;
private String errorId;
private String errorMessage;
+ private RpcEndpointInfos serverInfos;
public BitToUserHandshake()
{
@@ -111,6 +112,19 @@ public final class BitToUserHandshake implements Externalizable, Message<BitToUs
return this;
}
+ // serverInfos
+
+ public RpcEndpointInfos getServerInfos()
+ {
+ return serverInfos;
+ }
+
+ public BitToUserHandshake setServerInfos(RpcEndpointInfos serverInfos)
+ {
+ this.serverInfos = serverInfos;
+ return this;
+ }
+
// java serialization
public void readExternal(ObjectInput in) throws IOException
@@ -177,6 +191,10 @@ public final class BitToUserHandshake implements Externalizable, Message<BitToUs
case 5:
message.errorMessage = input.readString();
break;
+ case 6:
+ message.serverInfos = input.mergeObject(message.serverInfos, RpcEndpointInfos.getSchema());
+ break;
+
default:
input.handleUnknownField(number, this);
}
@@ -197,6 +215,10 @@ public final class BitToUserHandshake implements Externalizable, Message<BitToUs
if(message.errorMessage != null)
output.writeString(5, message.errorMessage, false);
+
+ if(message.serverInfos != null)
+ output.writeObject(6, message.serverInfos, RpcEndpointInfos.getSchema(), false);
+
}
public String getFieldName(int number)
@@ -207,6 +229,7 @@ public final class BitToUserHandshake implements Externalizable, Message<BitToUs
case 3: return "status";
case 4: return "errorId";
case 5: return "errorMessage";
+ case 6: return "serverInfos";
default: return null;
}
}
@@ -224,6 +247,7 @@ public final class BitToUserHandshake implements Externalizable, Message<BitToUs
__fieldMap.put("status", 3);
__fieldMap.put("errorId", 4);
__fieldMap.put("errorMessage", 5);
+ __fieldMap.put("serverInfos", 6);
}
}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcEndpointInfos.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcEndpointInfos.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcEndpointInfos.java
new file mode 100644
index 0000000..9849e56
--- /dev/null
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/RpcEndpointInfos.java
@@ -0,0 +1,273 @@
+/**
+ * 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.
+ */
+// Generated by http://code.google.com/p/protostuff/ ... DO NOT EDIT!
+// Generated from protobuf
+
+package org.apache.drill.exec.proto.beans;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import com.dyuproject.protostuff.GraphIOUtil;
+import com.dyuproject.protostuff.Input;
+import com.dyuproject.protostuff.Message;
+import com.dyuproject.protostuff.Output;
+import com.dyuproject.protostuff.Schema;
+
+public final class RpcEndpointInfos implements Externalizable, Message<RpcEndpointInfos>, Schema<RpcEndpointInfos>
+{
+
+ public static Schema<RpcEndpointInfos> getSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ public static RpcEndpointInfos getDefaultInstance()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ static final RpcEndpointInfos DEFAULT_INSTANCE = new RpcEndpointInfos();
+
+
+ private String name;
+ private String version;
+ private int majorVersion;
+ private int minorVersion;
+ private int patchVersion;
+ private String application;
+
+ public RpcEndpointInfos()
+ {
+
+ }
+
+ // getters and setters
+
+ // name
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public RpcEndpointInfos setName(String name)
+ {
+ this.name = name;
+ return this;
+ }
+
+ // version
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public RpcEndpointInfos setVersion(String version)
+ {
+ this.version = version;
+ return this;
+ }
+
+ // majorVersion
+
+ public int getMajorVersion()
+ {
+ return majorVersion;
+ }
+
+ public RpcEndpointInfos setMajorVersion(int majorVersion)
+ {
+ this.majorVersion = majorVersion;
+ return this;
+ }
+
+ // minorVersion
+
+ public int getMinorVersion()
+ {
+ return minorVersion;
+ }
+
+ public RpcEndpointInfos setMinorVersion(int minorVersion)
+ {
+ this.minorVersion = minorVersion;
+ return this;
+ }
+
+ // patchVersion
+
+ public int getPatchVersion()
+ {
+ return patchVersion;
+ }
+
+ public RpcEndpointInfos setPatchVersion(int patchVersion)
+ {
+ this.patchVersion = patchVersion;
+ return this;
+ }
+
+ // application
+
+ public String getApplication()
+ {
+ return application;
+ }
+
+ public RpcEndpointInfos setApplication(String application)
+ {
+ this.application = application;
+ return this;
+ }
+
+ // java serialization
+
+ public void readExternal(ObjectInput in) throws IOException
+ {
+ GraphIOUtil.mergeDelimitedFrom(in, this, this);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ GraphIOUtil.writeDelimitedTo(out, this, this);
+ }
+
+ // message method
+
+ public Schema<RpcEndpointInfos> cachedSchema()
+ {
+ return DEFAULT_INSTANCE;
+ }
+
+ // schema methods
+
+ public RpcEndpointInfos newMessage()
+ {
+ return new RpcEndpointInfos();
+ }
+
+ public Class<RpcEndpointInfos> typeClass()
+ {
+ return RpcEndpointInfos.class;
+ }
+
+ public String messageName()
+ {
+ return RpcEndpointInfos.class.getSimpleName();
+ }
+
+ public String messageFullName()
+ {
+ return RpcEndpointInfos.class.getName();
+ }
+
+ public boolean isInitialized(RpcEndpointInfos message)
+ {
+ return true;
+ }
+
+ public void mergeFrom(Input input, RpcEndpointInfos message) throws IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ message.name = input.readString();
+ break;
+ case 2:
+ message.version = input.readString();
+ break;
+ case 3:
+ message.majorVersion = input.readUInt32();
+ break;
+ case 4:
+ message.minorVersion = input.readUInt32();
+ break;
+ case 5:
+ message.patchVersion = input.readUInt32();
+ break;
+ case 6:
+ message.application = input.readString();
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+
+
+ public void writeTo(Output output, RpcEndpointInfos message) throws IOException
+ {
+ if(message.name != null)
+ output.writeString(1, message.name, false);
+
+ if(message.version != null)
+ output.writeString(2, message.version, false);
+
+ if(message.majorVersion != 0)
+ output.writeUInt32(3, message.majorVersion, false);
+
+ if(message.minorVersion != 0)
+ output.writeUInt32(4, message.minorVersion, false);
+
+ if(message.patchVersion != 0)
+ output.writeUInt32(5, message.patchVersion, false);
+
+ if(message.application != null)
+ output.writeString(6, message.application, false);
+ }
+
+ public String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "name";
+ case 2: return "version";
+ case 3: return "majorVersion";
+ case 4: return "minorVersion";
+ case 5: return "patchVersion";
+ case 6: return "application";
+ default: return null;
+ }
+ }
+
+ public int getFieldNumber(String name)
+ {
+ final Integer number = __fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+
+ private static final java.util.HashMap<String,Integer> __fieldMap = new java.util.HashMap<String,Integer>();
+ static
+ {
+ __fieldMap.put("name", 1);
+ __fieldMap.put("version", 2);
+ __fieldMap.put("majorVersion", 3);
+ __fieldMap.put("minorVersion", 4);
+ __fieldMap.put("patchVersion", 5);
+ __fieldMap.put("application", 6);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/protocol/src/main/java/org/apache/drill/exec/proto/beans/UserToBitHandshake.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/UserToBitHandshake.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/UserToBitHandshake.java
index efd8e58..7f524fe 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/UserToBitHandshake.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/UserToBitHandshake.java
@@ -56,6 +56,7 @@ public final class UserToBitHandshake implements Externalizable, Message<UserToB
private UserProperties properties;
private Boolean supportComplexTypes = DEFAULT_SUPPORT_COMPLEX_TYPES;
private Boolean supportTimeout = DEFAULT_SUPPORT_TIMEOUT;
+ private RpcEndpointInfos clientInfos;
public UserToBitHandshake()
{
@@ -155,6 +156,19 @@ public final class UserToBitHandshake implements Externalizable, Message<UserToB
return this;
}
+ // clientInfos
+
+ public RpcEndpointInfos getClientInfos()
+ {
+ return clientInfos;
+ }
+
+ public UserToBitHandshake setClientInfos(RpcEndpointInfos clientInfos)
+ {
+ this.clientInfos = clientInfos;
+ return this;
+ }
+
// java serialization
public void readExternal(ObjectInput in) throws IOException
@@ -232,6 +246,10 @@ public final class UserToBitHandshake implements Externalizable, Message<UserToB
case 7:
message.supportTimeout = input.readBool();
break;
+ case 8:
+ message.clientInfos = input.mergeObject(message.clientInfos, RpcEndpointInfos.getSchema());
+ break;
+
default:
input.handleUnknownField(number, this);
}
@@ -263,6 +281,10 @@ public final class UserToBitHandshake implements Externalizable, Message<UserToB
if(message.supportTimeout != null && message.supportTimeout != DEFAULT_SUPPORT_TIMEOUT)
output.writeBool(7, message.supportTimeout, false);
+
+ if(message.clientInfos != null)
+ output.writeObject(8, message.clientInfos, RpcEndpointInfos.getSchema(), false);
+
}
public String getFieldName(int number)
@@ -276,6 +298,7 @@ public final class UserToBitHandshake implements Externalizable, Message<UserToB
case 5: return "properties";
case 6: return "supportComplexTypes";
case 7: return "supportTimeout";
+ case 8: return "clientInfos";
default: return null;
}
}
@@ -296,6 +319,7 @@ public final class UserToBitHandshake implements Externalizable, Message<UserToB
__fieldMap.put("properties", 5);
__fieldMap.put("supportComplexTypes", 6);
__fieldMap.put("supportTimeout", 7);
+ __fieldMap.put("clientInfos", 8);
}
}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/protocol/src/main/protobuf/User.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/User.proto b/protocol/src/main/protobuf/User.proto
index 62c401a..fe8dc3d 100644
--- a/protocol/src/main/protobuf/User.proto
+++ b/protocol/src/main/protobuf/User.proto
@@ -54,6 +54,15 @@ message UserProperties {
repeated Property properties = 1;
}
+message RpcEndpointInfos {
+ optional string name = 1; // example: Apache Drill Server, Apache Drill C++ client
+ optional string version = 2; // example: 1.9.0
+ optional uint32 majorVersion = 3; // example: 1
+ optional uint32 minorVersion = 4; // example: 9
+ optional uint32 patchVersion = 5; // example: 0
+ optional string application = 6; // example: Tableau 9.3
+}
+
message UserToBitHandshake {
optional exec.shared.RpcChannel channel = 1 [default = USER];
optional bool support_listening = 2;
@@ -62,6 +71,7 @@ message UserToBitHandshake {
optional UserProperties properties = 5;
optional bool support_complex_types = 6 [default = false];
optional bool support_timeout = 7 [default = false];
+ optional RpcEndpointInfos client_infos = 8;
}
message RequestResults {
@@ -100,6 +110,7 @@ message BitToUserHandshake {
optional HandshakeStatus status = 3;
optional string errorId = 4;
optional string errorMessage = 5;
+ optional RpcEndpointInfos server_infos = 6;
}
/*
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/FMPPMojo.java
----------------------------------------------------------------------
diff --git a/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/FMPPMojo.java b/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/FMPPMojo.java
index 6f3833f..2d70c64 100644
--- a/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/FMPPMojo.java
+++ b/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/FMPPMojo.java
@@ -25,6 +25,7 @@ import java.nio.file.Files;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.FileUtils;
+import org.apache.drill.fmpp.mojo.MavenDataLoader.MavenData;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -62,7 +63,6 @@ public class FMPPMojo extends AbstractMojo {
*/
private File templates;
-
/**
* Where to write the generated files of the output files.
*
@@ -87,6 +87,14 @@ public class FMPPMojo extends AbstractMojo {
*/
private String scope;
+ /**
+ * if maven properties are added as data
+ *
+ * @parameter default-value="true"
+ * @required
+ */
+ private boolean addMavenDataLoader;
+
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (project == null) {
@@ -121,8 +129,8 @@ public class FMPPMojo extends AbstractMojo {
String tmpPath = tmp.getAbsolutePath();
final String tmpPathNormalized = tmpPath.endsWith(File.separator) ? tmpPath : tmpPath + File.separator;
Settings settings = new Settings(new File("."));
- settings.set("sourceRoot", templatesPath);
- settings.set("outputRoot", tmp.getAbsolutePath());
+ settings.set(Settings.NAME_SOURCE_ROOT, templatesPath);
+ settings.set(Settings.NAME_OUTPUT_ROOT, tmp.getAbsolutePath());
settings.load(config);
settings.addProgressListener(new TerseConsoleProgressListener());
settings.addProgressListener(new ProgressListener() {
@@ -146,6 +154,11 @@ public class FMPPMojo extends AbstractMojo {
}
}
} );
+ if (addMavenDataLoader) {
+ getLog().info("Adding maven data loader");
+ settings.setEngineAttribute(MavenDataLoader.MAVEN_DATA_ATTRIBUTE, new MavenData(project));
+ settings.add(Settings.NAME_DATA, format("maven: %s()", MavenDataLoader.class.getName()));
+ }
settings.execute();
} catch (Exception e) {
throw new MojoFailureException(MiscUtil.causeMessages(e), e);
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/MavenDataLoader.java
----------------------------------------------------------------------
diff --git a/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/MavenDataLoader.java b/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/MavenDataLoader.java
new file mode 100644
index 0000000..c330c25
--- /dev/null
+++ b/tools/fmpp/src/main/java/org/apache/drill/fmpp/mojo/MavenDataLoader.java
@@ -0,0 +1,55 @@
+/*
+ * 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.fmpp.mojo;
+
+import java.util.List;
+
+import org.apache.maven.project.MavenProject;
+
+import fmpp.Engine;
+import fmpp.tdd.DataLoader;
+
+/**
+ * A data loader for Maven
+ */
+public class MavenDataLoader implements DataLoader {
+ public static final class MavenData {
+ private final MavenProject project;
+
+ public MavenData(MavenProject project) {
+ this.project = project;
+ }
+
+ public MavenProject getProject() {
+ return project;
+ }
+ }
+
+ public static final String MAVEN_DATA_ATTRIBUTE = "maven.data";
+
+ @Override
+ public Object load(Engine e, List args) throws Exception {
+ if (!args.isEmpty()) {
+ throw new IllegalArgumentException("maven model data loader has no parameters");
+ }
+
+ MavenData data = (MavenData) e.getAttribute(MAVEN_DATA_ATTRIBUTE);
+ return data;
+ }
+
+}
[2/3] drill git commit: DRILL-4369: Exchange name and version infos
during handshake
Posted by ad...@apache.org.
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/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 4b73a41..f4f740d 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
@@ -2344,6 +2344,1272 @@ public final class UserProtos {
// @@protoc_insertion_point(class_scope:exec.user.UserProperties)
}
+ public interface RpcEndpointInfosOrBuilder
+ extends com.google.protobuf.MessageOrBuilder {
+
+ // optional string name = 1;
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ boolean hasName();
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ java.lang.String getName();
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getNameBytes();
+
+ // optional string version = 2;
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ boolean hasVersion();
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ java.lang.String getVersion();
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getVersionBytes();
+
+ // optional uint32 majorVersion = 3;
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ boolean hasMajorVersion();
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ int getMajorVersion();
+
+ // optional uint32 minorVersion = 4;
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ boolean hasMinorVersion();
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ int getMinorVersion();
+
+ // optional uint32 patchVersion = 5;
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ boolean hasPatchVersion();
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ int getPatchVersion();
+
+ // optional string application = 6;
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ boolean hasApplication();
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ java.lang.String getApplication();
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ com.google.protobuf.ByteString
+ getApplicationBytes();
+ }
+ /**
+ * Protobuf type {@code exec.user.RpcEndpointInfos}
+ */
+ public static final class RpcEndpointInfos extends
+ com.google.protobuf.GeneratedMessage
+ implements RpcEndpointInfosOrBuilder {
+ // Use RpcEndpointInfos.newBuilder() to construct.
+ private RpcEndpointInfos(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
+ super(builder);
+ this.unknownFields = builder.getUnknownFields();
+ }
+ private RpcEndpointInfos(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
+
+ private static final RpcEndpointInfos defaultInstance;
+ public static RpcEndpointInfos getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public RpcEndpointInfos getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ private final com.google.protobuf.UnknownFieldSet unknownFields;
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ private RpcEndpointInfos(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ initFields();
+ int mutable_bitField0_ = 0;
+ 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;
+ }
+ case 10: {
+ bitField0_ |= 0x00000001;
+ name_ = input.readBytes();
+ break;
+ }
+ case 18: {
+ bitField0_ |= 0x00000002;
+ version_ = input.readBytes();
+ break;
+ }
+ case 24: {
+ bitField0_ |= 0x00000004;
+ majorVersion_ = input.readUInt32();
+ break;
+ }
+ case 32: {
+ bitField0_ |= 0x00000008;
+ minorVersion_ = input.readUInt32();
+ break;
+ }
+ case 40: {
+ bitField0_ |= 0x00000010;
+ patchVersion_ = input.readUInt32();
+ break;
+ }
+ case 50: {
+ bitField0_ |= 0x00000020;
+ application_ = input.readBytes();
+ 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.UserProtos.internal_static_exec_user_RpcEndpointInfos_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RpcEndpointInfos_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder.class);
+ }
+
+ public static com.google.protobuf.Parser<RpcEndpointInfos> PARSER =
+ new com.google.protobuf.AbstractParser<RpcEndpointInfos>() {
+ public RpcEndpointInfos parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return new RpcEndpointInfos(input, extensionRegistry);
+ }
+ };
+
+ @java.lang.Override
+ public com.google.protobuf.Parser<RpcEndpointInfos> getParserForType() {
+ return PARSER;
+ }
+
+ private int bitField0_;
+ // optional string name = 1;
+ public static final int NAME_FIELD_NUMBER = 1;
+ private java.lang.Object name_;
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public boolean hasName() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ name_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ // optional string version = 2;
+ public static final int VERSION_FIELD_NUMBER = 2;
+ private java.lang.Object version_;
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public boolean hasVersion() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public java.lang.String getVersion() {
+ java.lang.Object ref = version_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ version_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getVersionBytes() {
+ java.lang.Object ref = version_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ version_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ // optional uint32 majorVersion = 3;
+ public static final int MAJORVERSION_FIELD_NUMBER = 3;
+ private int majorVersion_;
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ public boolean hasMajorVersion() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ public int getMajorVersion() {
+ return majorVersion_;
+ }
+
+ // optional uint32 minorVersion = 4;
+ public static final int MINORVERSION_FIELD_NUMBER = 4;
+ private int minorVersion_;
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ public boolean hasMinorVersion() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ public int getMinorVersion() {
+ return minorVersion_;
+ }
+
+ // optional uint32 patchVersion = 5;
+ public static final int PATCHVERSION_FIELD_NUMBER = 5;
+ private int patchVersion_;
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ public boolean hasPatchVersion() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ public int getPatchVersion() {
+ return patchVersion_;
+ }
+
+ // optional string application = 6;
+ public static final int APPLICATION_FIELD_NUMBER = 6;
+ private java.lang.Object application_;
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public boolean hasApplication() {
+ return ((bitField0_ & 0x00000020) == 0x00000020);
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public java.lang.String getApplication() {
+ java.lang.Object ref = application_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ if (bs.isValidUtf8()) {
+ application_ = s;
+ }
+ return s;
+ }
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getApplicationBytes() {
+ java.lang.Object ref = application_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ application_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ private void initFields() {
+ name_ = "";
+ version_ = "";
+ majorVersion_ = 0;
+ minorVersion_ = 0;
+ patchVersion_ = 0;
+ application_ = "";
+ }
+ 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();
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ output.writeBytes(1, getNameBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ output.writeBytes(2, getVersionBytes());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ output.writeUInt32(3, majorVersion_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ output.writeUInt32(4, minorVersion_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ output.writeUInt32(5, patchVersion_);
+ }
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ output.writeBytes(6, getApplicationBytes());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) == 0x00000001)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(1, getNameBytes());
+ }
+ if (((bitField0_ & 0x00000002) == 0x00000002)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, getVersionBytes());
+ }
+ if (((bitField0_ & 0x00000004) == 0x00000004)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(3, majorVersion_);
+ }
+ if (((bitField0_ & 0x00000008) == 0x00000008)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(4, minorVersion_);
+ }
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32Size(5, patchVersion_);
+ }
+ if (((bitField0_ & 0x00000020) == 0x00000020)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(6, getApplicationBytes());
+ }
+ 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.UserProtos.RpcEndpointInfos parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos 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.UserProtos.RpcEndpointInfos parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos 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.UserProtos.RpcEndpointInfos parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos 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.UserProtos.RpcEndpointInfos parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return PARSER.parseDelimitedFrom(input);
+ }
+ public static org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos 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.UserProtos.RpcEndpointInfos parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return PARSER.parseFrom(input);
+ }
+ public static org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos 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.UserProtos.RpcEndpointInfos 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.user.RpcEndpointInfos}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder<Builder>
+ implements org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RpcEndpointInfos_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RpcEndpointInfos_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder.class);
+ }
+
+ // Construct using org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.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();
+ name_ = "";
+ bitField0_ = (bitField0_ & ~0x00000001);
+ version_ = "";
+ bitField0_ = (bitField0_ & ~0x00000002);
+ majorVersion_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ minorVersion_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ patchVersion_ = 0;
+ bitField0_ = (bitField0_ & ~0x00000010);
+ application_ = "";
+ bitField0_ = (bitField0_ & ~0x00000020);
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(buildPartial());
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return org.apache.drill.exec.proto.UserProtos.internal_static_exec_user_RpcEndpointInfos_descriptor;
+ }
+
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getDefaultInstanceForType() {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ }
+
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos build() {
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos buildPartial() {
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos result = new org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos(this);
+ int from_bitField0_ = bitField0_;
+ int to_bitField0_ = 0;
+ if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
+ to_bitField0_ |= 0x00000001;
+ }
+ result.name_ = name_;
+ if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
+ to_bitField0_ |= 0x00000002;
+ }
+ result.version_ = version_;
+ if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
+ to_bitField0_ |= 0x00000004;
+ }
+ result.majorVersion_ = majorVersion_;
+ if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+ to_bitField0_ |= 0x00000008;
+ }
+ result.minorVersion_ = minorVersion_;
+ if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ result.patchVersion_ = patchVersion_;
+ if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+ to_bitField0_ |= 0x00000020;
+ }
+ result.application_ = application_;
+ result.bitField0_ = to_bitField0_;
+ onBuilt();
+ return result;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos) {
+ return mergeFrom((org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos other) {
+ if (other == org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance()) return this;
+ if (other.hasName()) {
+ bitField0_ |= 0x00000001;
+ name_ = other.name_;
+ onChanged();
+ }
+ if (other.hasVersion()) {
+ bitField0_ |= 0x00000002;
+ version_ = other.version_;
+ onChanged();
+ }
+ if (other.hasMajorVersion()) {
+ setMajorVersion(other.getMajorVersion());
+ }
+ if (other.hasMinorVersion()) {
+ setMinorVersion(other.getMinorVersion());
+ }
+ if (other.hasPatchVersion()) {
+ setPatchVersion(other.getPatchVersion());
+ }
+ if (other.hasApplication()) {
+ bitField0_ |= 0x00000020;
+ application_ = other.application_;
+ onChanged();
+ }
+ 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.UserProtos.RpcEndpointInfos parsedMessage = null;
+ try {
+ parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ parsedMessage = (org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos) e.getUnfinishedMessage();
+ throw e;
+ } finally {
+ if (parsedMessage != null) {
+ mergeFrom(parsedMessage);
+ }
+ }
+ return this;
+ }
+ private int bitField0_;
+
+ // optional string name = 1;
+ private java.lang.Object name_ = "";
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public boolean hasName() {
+ return ((bitField0_ & 0x00000001) == 0x00000001);
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public Builder setName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public Builder clearName() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string name = 1;</code>
+ *
+ * <pre>
+ * example: Apache Drill Server, Apache Drill C++ client
+ * </pre>
+ */
+ public Builder setNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000001;
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional string version = 2;
+ private java.lang.Object version_ = "";
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public boolean hasVersion() {
+ return ((bitField0_ & 0x00000002) == 0x00000002);
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public java.lang.String getVersion() {
+ java.lang.Object ref = version_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ version_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getVersionBytes() {
+ java.lang.Object ref = version_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ version_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public Builder setVersion(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ version_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public Builder clearVersion() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ version_ = getDefaultInstance().getVersion();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string version = 2;</code>
+ *
+ * <pre>
+ * example: 1.9.0
+ * </pre>
+ */
+ public Builder setVersionBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000002;
+ version_ = value;
+ onChanged();
+ return this;
+ }
+
+ // optional uint32 majorVersion = 3;
+ private int majorVersion_ ;
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ public boolean hasMajorVersion() {
+ return ((bitField0_ & 0x00000004) == 0x00000004);
+ }
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ public int getMajorVersion() {
+ return majorVersion_;
+ }
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ public Builder setMajorVersion(int value) {
+ bitField0_ |= 0x00000004;
+ majorVersion_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional uint32 majorVersion = 3;</code>
+ *
+ * <pre>
+ * example: 1
+ * </pre>
+ */
+ public Builder clearMajorVersion() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ majorVersion_ = 0;
+ onChanged();
+ return this;
+ }
+
+ // optional uint32 minorVersion = 4;
+ private int minorVersion_ ;
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ public boolean hasMinorVersion() {
+ return ((bitField0_ & 0x00000008) == 0x00000008);
+ }
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ public int getMinorVersion() {
+ return minorVersion_;
+ }
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ public Builder setMinorVersion(int value) {
+ bitField0_ |= 0x00000008;
+ minorVersion_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional uint32 minorVersion = 4;</code>
+ *
+ * <pre>
+ * example: 9
+ * </pre>
+ */
+ public Builder clearMinorVersion() {
+ bitField0_ = (bitField0_ & ~0x00000008);
+ minorVersion_ = 0;
+ onChanged();
+ return this;
+ }
+
+ // optional uint32 patchVersion = 5;
+ private int patchVersion_ ;
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ public boolean hasPatchVersion() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ public int getPatchVersion() {
+ return patchVersion_;
+ }
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ public Builder setPatchVersion(int value) {
+ bitField0_ |= 0x00000010;
+ patchVersion_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional uint32 patchVersion = 5;</code>
+ *
+ * <pre>
+ * example: 0
+ * </pre>
+ */
+ public Builder clearPatchVersion() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ patchVersion_ = 0;
+ onChanged();
+ return this;
+ }
+
+ // optional string application = 6;
+ private java.lang.Object application_ = "";
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public boolean hasApplication() {
+ return ((bitField0_ & 0x00000020) == 0x00000020);
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public java.lang.String getApplication() {
+ java.lang.Object ref = application_;
+ if (!(ref instanceof java.lang.String)) {
+ java.lang.String s = ((com.google.protobuf.ByteString) ref)
+ .toStringUtf8();
+ application_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public com.google.protobuf.ByteString
+ getApplicationBytes() {
+ java.lang.Object ref = application_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ application_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public Builder setApplication(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ application_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public Builder clearApplication() {
+ bitField0_ = (bitField0_ & ~0x00000020);
+ application_ = getDefaultInstance().getApplication();
+ onChanged();
+ return this;
+ }
+ /**
+ * <code>optional string application = 6;</code>
+ *
+ * <pre>
+ * example: Tableau 9.3
+ * </pre>
+ */
+ public Builder setApplicationBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ bitField0_ |= 0x00000020;
+ application_ = value;
+ onChanged();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:exec.user.RpcEndpointInfos)
+ }
+
+ static {
+ defaultInstance = new RpcEndpointInfos(true);
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:exec.user.RpcEndpointInfos)
+ }
+
public interface UserToBitHandshakeOrBuilder
extends com.google.protobuf.MessageOrBuilder {
@@ -2423,7 +3689,21 @@ public final class UserProtos {
/**
* <code>optional bool support_timeout = 7 [default = false];</code>
*/
- boolean getSupportTimeout();
+ boolean getSupportTimeout();
+
+ // optional .exec.user.RpcEndpointInfos client_infos = 8;
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ boolean hasClientInfos();
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getClientInfos();
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder getClientInfosOrBuilder();
}
/**
* Protobuf type {@code exec.user.UserToBitHandshake}
@@ -2533,6 +3813,19 @@ public final class UserProtos {
supportTimeout_ = input.readBool();
break;
}
+ case 66: {
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ subBuilder = clientInfos_.toBuilder();
+ }
+ clientInfos_ = input.readMessage(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(clientInfos_);
+ clientInfos_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000080;
+ break;
+ }
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -2697,6 +3990,28 @@ public final class UserProtos {
return supportTimeout_;
}
+ // optional .exec.user.RpcEndpointInfos client_infos = 8;
+ public static final int CLIENT_INFOS_FIELD_NUMBER = 8;
+ private org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos clientInfos_;
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public boolean hasClientInfos() {
+ return ((bitField0_ & 0x00000080) == 0x00000080);
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getClientInfos() {
+ return clientInfos_;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder getClientInfosOrBuilder() {
+ return clientInfos_;
+ }
+
private void initFields() {
channel_ = org.apache.drill.exec.proto.UserBitShared.RpcChannel.USER;
supportListening_ = false;
@@ -2705,6 +4020,7 @@ public final class UserProtos {
properties_ = org.apache.drill.exec.proto.UserProtos.UserProperties.getDefaultInstance();
supportComplexTypes_ = false;
supportTimeout_ = false;
+ clientInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -2745,6 +4061,9 @@ public final class UserProtos {
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBool(7, supportTimeout_);
}
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ output.writeMessage(8, clientInfos_);
+ }
getUnknownFields().writeTo(output);
}
@@ -2782,6 +4101,10 @@ public final class UserProtos {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(7, supportTimeout_);
}
+ if (((bitField0_ & 0x00000080) == 0x00000080)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(8, clientInfos_);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -2892,6 +4215,7 @@ public final class UserProtos {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getCredentialsFieldBuilder();
getPropertiesFieldBuilder();
+ getClientInfosFieldBuilder();
}
}
private static Builder create() {
@@ -2922,6 +4246,12 @@ public final class UserProtos {
bitField0_ = (bitField0_ & ~0x00000020);
supportTimeout_ = false;
bitField0_ = (bitField0_ & ~0x00000040);
+ if (clientInfosBuilder_ == null) {
+ clientInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ } else {
+ clientInfosBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
@@ -2986,6 +4316,14 @@ public final class UserProtos {
to_bitField0_ |= 0x00000040;
}
result.supportTimeout_ = supportTimeout_;
+ if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
+ to_bitField0_ |= 0x00000080;
+ }
+ if (clientInfosBuilder_ == null) {
+ result.clientInfos_ = clientInfos_;
+ } else {
+ result.clientInfos_ = clientInfosBuilder_.build();
+ }
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -3023,6 +4361,9 @@ public final class UserProtos {
if (other.hasSupportTimeout()) {
setSupportTimeout(other.getSupportTimeout());
}
+ if (other.hasClientInfos()) {
+ mergeClientInfos(other.getClientInfos());
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -3458,6 +4799,123 @@ public final class UserProtos {
return this;
}
+ // optional .exec.user.RpcEndpointInfos client_infos = 8;
+ private org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos clientInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder> clientInfosBuilder_;
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public boolean hasClientInfos() {
+ return ((bitField0_ & 0x00000080) == 0x00000080);
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getClientInfos() {
+ if (clientInfosBuilder_ == null) {
+ return clientInfos_;
+ } else {
+ return clientInfosBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public Builder setClientInfos(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos value) {
+ if (clientInfosBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ clientInfos_ = value;
+ onChanged();
+ } else {
+ clientInfosBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000080;
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public Builder setClientInfos(
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder builderForValue) {
+ if (clientInfosBuilder_ == null) {
+ clientInfos_ = builderForValue.build();
+ onChanged();
+ } else {
+ clientInfosBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000080;
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public Builder mergeClientInfos(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos value) {
+ if (clientInfosBuilder_ == null) {
+ if (((bitField0_ & 0x00000080) == 0x00000080) &&
+ clientInfos_ != org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance()) {
+ clientInfos_ =
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder(clientInfos_).mergeFrom(value).buildPartial();
+ } else {
+ clientInfos_ = value;
+ }
+ onChanged();
+ } else {
+ clientInfosBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000080;
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public Builder clearClientInfos() {
+ if (clientInfosBuilder_ == null) {
+ clientInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ onChanged();
+ } else {
+ clientInfosBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000080);
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder getClientInfosBuilder() {
+ bitField0_ |= 0x00000080;
+ onChanged();
+ return getClientInfosFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder getClientInfosOrBuilder() {
+ if (clientInfosBuilder_ != null) {
+ return clientInfosBuilder_.getMessageOrBuilder();
+ } else {
+ return clientInfos_;
+ }
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos client_infos = 8;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder>
+ getClientInfosFieldBuilder() {
+ if (clientInfosBuilder_ == null) {
+ clientInfosBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder>(
+ clientInfos_,
+ getParentForChildren(),
+ isClean());
+ clientInfos_ = null;
+ }
+ return clientInfosBuilder_;
+ }
+
// @@protoc_insertion_point(builder_scope:exec.user.UserToBitHandshake)
}
@@ -5918,6 +7376,20 @@ public final class UserProtos {
*/
com.google.protobuf.ByteString
getErrorMessageBytes();
+
+ // optional .exec.user.RpcEndpointInfos server_infos = 6;
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ boolean hasServerInfos();
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getServerInfos();
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder getServerInfosOrBuilder();
}
/**
* Protobuf type {@code exec.user.BitToUserHandshake}
@@ -5996,6 +7468,19 @@ public final class UserProtos {
errorMessage_ = input.readBytes();
break;
}
+ case 50: {
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder subBuilder = null;
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ subBuilder = serverInfos_.toBuilder();
+ }
+ serverInfos_ = input.readMessage(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.PARSER, extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(serverInfos_);
+ serverInfos_ = subBuilder.buildPartial();
+ }
+ bitField0_ |= 0x00000010;
+ break;
+ }
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -6154,11 +7639,34 @@ public final class UserProtos {
}
}
+ // optional .exec.user.RpcEndpointInfos server_infos = 6;
+ public static final int SERVER_INFOS_FIELD_NUMBER = 6;
+ private org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos serverInfos_;
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public boolean hasServerInfos() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getServerInfos() {
+ return serverInfos_;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder getServerInfosOrBuilder() {
+ return serverInfos_;
+ }
+
private void initFields() {
rpcVersion_ = 0;
status_ = org.apache.drill.exec.proto.UserProtos.HandshakeStatus.SUCCESS;
errorId_ = "";
errorMessage_ = "";
+ serverInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -6184,6 +7692,9 @@ public final class UserProtos {
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(5, getErrorMessageBytes());
}
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ output.writeMessage(6, serverInfos_);
+ }
getUnknownFields().writeTo(output);
}
@@ -6209,6 +7720,10 @@ public final class UserProtos {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getErrorMessageBytes());
}
+ if (((bitField0_ & 0x00000010) == 0x00000010)) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(6, serverInfos_);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -6317,6 +7832,7 @@ public final class UserProtos {
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
+ getServerInfosFieldBuilder();
}
}
private static Builder create() {
@@ -6333,6 +7849,12 @@ public final class UserProtos {
bitField0_ = (bitField0_ & ~0x00000004);
errorMessage_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
+ if (serverInfosBuilder_ == null) {
+ serverInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ } else {
+ serverInfosBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
@@ -6377,6 +7899,14 @@ public final class UserProtos {
to_bitField0_ |= 0x00000008;
}
result.errorMessage_ = errorMessage_;
+ if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+ to_bitField0_ |= 0x00000010;
+ }
+ if (serverInfosBuilder_ == null) {
+ result.serverInfos_ = serverInfos_;
+ } else {
+ result.serverInfos_ = serverInfosBuilder_.build();
+ }
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -6409,6 +7939,9 @@ public final class UserProtos {
errorMessage_ = other.errorMessage_;
onChanged();
}
+ if (other.hasServerInfos()) {
+ mergeServerInfos(other.getServerInfos());
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -6653,6 +8186,123 @@ public final class UserProtos {
return this;
}
+ // optional .exec.user.RpcEndpointInfos server_infos = 6;
+ private org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos serverInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder> serverInfosBuilder_;
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public boolean hasServerInfos() {
+ return ((bitField0_ & 0x00000010) == 0x00000010);
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos getServerInfos() {
+ if (serverInfosBuilder_ == null) {
+ return serverInfos_;
+ } else {
+ return serverInfosBuilder_.getMessage();
+ }
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public Builder setServerInfos(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos value) {
+ if (serverInfosBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ serverInfos_ = value;
+ onChanged();
+ } else {
+ serverInfosBuilder_.setMessage(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public Builder setServerInfos(
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder builderForValue) {
+ if (serverInfosBuilder_ == null) {
+ serverInfos_ = builderForValue.build();
+ onChanged();
+ } else {
+ serverInfosBuilder_.setMessage(builderForValue.build());
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public Builder mergeServerInfos(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos value) {
+ if (serverInfosBuilder_ == null) {
+ if (((bitField0_ & 0x00000010) == 0x00000010) &&
+ serverInfos_ != org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance()) {
+ serverInfos_ =
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder(serverInfos_).mergeFrom(value).buildPartial();
+ } else {
+ serverInfos_ = value;
+ }
+ onChanged();
+ } else {
+ serverInfosBuilder_.mergeFrom(value);
+ }
+ bitField0_ |= 0x00000010;
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public Builder clearServerInfos() {
+ if (serverInfosBuilder_ == null) {
+ serverInfos_ = org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.getDefaultInstance();
+ onChanged();
+ } else {
+ serverInfosBuilder_.clear();
+ }
+ bitField0_ = (bitField0_ & ~0x00000010);
+ return this;
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder getServerInfosBuilder() {
+ bitField0_ |= 0x00000010;
+ onChanged();
+ return getServerInfosFieldBuilder().getBuilder();
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder getServerInfosOrBuilder() {
+ if (serverInfosBuilder_ != null) {
+ return serverInfosBuilder_.getMessageOrBuilder();
+ } else {
+ return serverInfos_;
+ }
+ }
+ /**
+ * <code>optional .exec.user.RpcEndpointInfos server_infos = 6;</code>
+ */
+ private com.google.protobuf.SingleFieldBuilder<
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder>
+ getServerInfosFieldBuilder() {
+ if (serverInfosBuilder_ == null) {
+ serverInfosBuilder_ = new com.google.protobuf.SingleFieldBuilder<
+ org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfosOrBuilder>(
+ serverInfos_,
+ getParentForChildren(),
+ isClean());
+ serverInfos_ = null;
+ }
+ return serverInfosBuilder_;
+ }
+
// @@protoc_insertion_point(builder_scope:exec.user.BitToUserHandshake)
}
@@ -27318,6 +28968,11 @@ public final class UserProtos {
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_exec_user_UserProperties_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_exec_user_RpcEndpointInfos_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_exec_user_RpcEndpointInfos_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
internal_static_exec_user_UserToBitHandshake_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
@@ -27451,125 +29106,131 @@ public final class UserProtos {
"tControl.proto\032\025ExecutionProtos.proto\"&\n" +
"\010Property\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 \002(\t\"9\n" +
"\016UserProperties\022\'\n\nproperties\030\001 \003(\0132\023.ex" +
- "ec.user.Property\"\234\002\n\022UserToBitHandshake\022" +
- ".\n\007channel\030\001 \001(\0162\027.exec.shared.RpcChanne" +
- "l:\004USER\022\031\n\021support_listening\030\002 \001(\010\022\023\n\013rp" +
- "c_version\030\003 \001(\005\0221\n\013credentials\030\004 \001(\0132\034.e" +
- "xec.shared.UserCredentials\022-\n\nproperties",
- "\030\005 \001(\0132\031.exec.user.UserProperties\022$\n\025sup" +
- "port_complex_types\030\006 \001(\010:\005false\022\036\n\017suppo" +
- "rt_timeout\030\007 \001(\010:\005false\"S\n\016RequestResult" +
- "s\022&\n\010query_id\030\001 \001(\0132\024.exec.shared.QueryI" +
- "d\022\031\n\021maximum_responses\030\002 \001(\005\"g\n\025GetQuery" +
- "PlanFragments\022\r\n\005query\030\001 \002(\t\022$\n\004type\030\002 \001" +
- "(\0162\026.exec.shared.QueryType\022\031\n\nsplit_plan" +
- "\030\003 \001(\010:\005false\"\316\001\n\022QueryPlanFragments\0223\n\006" +
- "status\030\001 \002(\0162#.exec.shared.QueryResult.Q" +
- "ueryState\022&\n\010query_id\030\002 \001(\0132\024.exec.share",
- "d.QueryId\0221\n\tfragments\030\003 \003(\0132\036.exec.bit." +
- "control.PlanFragment\022(\n\005error\030\004 \001(\0132\031.ex" +
- "ec.shared.DrillPBError\"|\n\022BitToUserHands" +
- "hake\022\023\n\013rpc_version\030\002 \001(\005\022*\n\006status\030\003 \001(" +
- "\0162\032.exec.user.HandshakeStatus\022\017\n\007errorId" +
- "\030\004 \001(\t\022\024\n\014errorMessage\030\005 \001(\t\"-\n\nLikeFilt" +
- "er\022\017\n\007pattern\030\001 \001(\t\022\016\n\006escape\030\002 \001(\t\"D\n\016G" +
- "etCatalogsReq\0222\n\023catalog_name_filter\030\001 \001" +
- "(\0132\025.exec.user.LikeFilter\"M\n\017CatalogMeta" +
- "data\022\024\n\014catalog_name\030\001 \001(\t\022\023\n\013descriptio",
- "n\030\002 \001(\t\022\017\n\007connect\030\003 \001(\t\"\223\001\n\017GetCatalogs" +
- "Resp\022(\n\006status\030\001 \001(\0162\030.exec.user.Request" +
- "Status\022,\n\010catalogs\030\002 \003(\0132\032.exec.user.Cat" +
- "alogMetadata\022(\n\005error\030\003 \001(\0132\031.exec.share" +
- "d.DrillPBError\"v\n\rGetSchemasReq\0222\n\023catal" +
- "og_name_filter\030\001 \001(\0132\025.exec.user.LikeFil" +
- "ter\0221\n\022schema_name_filter\030\002 \001(\0132\025.exec.u" +
- "ser.LikeFilter\"i\n\016SchemaMetadata\022\024\n\014cata" +
- "log_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\r\n\005o" +
- "wner\030\003 \001(\t\022\014\n\004type\030\004 \001(\t\022\017\n\007mutable\030\005 \001(",
- "\t\"\220\001\n\016GetSchemasResp\022(\n\006status\030\001 \001(\0162\030.e" +
- "xec.user.RequestStatus\022*\n\007schemas\030\002 \003(\0132" +
- "\031.exec.user.SchemaMetadata\022(\n\005error\030\003 \001(" +
- "\0132\031.exec.shared.DrillPBError\"\302\001\n\014GetTabl" +
- "esReq\0222\n\023catalog_name_filter\030\001 \001(\0132\025.exe" +
- "c.user.LikeFilter\0221\n\022schema_name_filter\030" +
- "\002 \001(\0132\025.exec.user.LikeFilter\0220\n\021table_na" +
- "me_filter\030\003 \001(\0132\025.exec.user.LikeFilter\022\031" +
- "\n\021table_type_filter\030\004 \003(\t\"\\\n\rTableMetada" +
- "ta\022\024\n\014catalog_name\030\001 \001(\t\022\023\n\013schema_name\030",
- "\002 \001(\t\022\022\n\ntable_name\030\003 \001(\t\022\014\n\004type\030\004 \001(\t\"" +
- "\215\001\n\rGetTablesResp\022(\n\006status\030\001 \001(\0162\030.exec" +
- ".user.RequestStatus\022(\n\006tables\030\002 \003(\0132\030.ex" +
- "ec.user.TableMetadata\022(\n\005error\030\003 \001(\0132\031.e" +
- "xec.shared.DrillPBError\"\333\001\n\rGetColumnsRe" +
- "q\0222\n\023catalog_name_filter\030\001 \001(\0132\025.exec.us" +
- "er.LikeFilter\0221\n\022schema_name_filter\030\002 \001(" +
- "\0132\025.exec.user.LikeFilter\0220\n\021table_name_f" +
- "ilter\030\003 \001(\0132\025.exec.user.LikeFilter\0221\n\022co" +
- "lumn_name_filter\030\004 \001(\0132\025.exec.user.LikeF",
- "ilter\"\224\003\n\016ColumnMetadata\022\024\n\014catalog_name" +
- "\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntable_nam" +
- "e\030\003 \001(\t\022\023\n\013column_name\030\004 \001(\t\022\030\n\020ordinal_" +
- "position\030\005 \001(\005\022\025\n\rdefault_value\030\006 \001(\t\022\023\n" +
- "\013is_nullable\030\007 \001(\010\022\021\n\tdata_type\030\010 \001(\t\022\027\n" +
- "\017char_max_length\030\t \001(\005\022\031\n\021char_octet_len" +
- "gth\030\n \001(\005\022\031\n\021numeric_precision\030\013 \001(\005\022\037\n\027" +
- "numeric_precision_radix\030\014 \001(\005\022\025\n\rnumeric" +
- "_scale\030\r \001(\005\022\033\n\023date_time_precision\030\016 \001(" +
- "\005\022\025\n\rinterval_type\030\017 \001(\t\022\032\n\022interval_pre",
- "cision\030\020 \001(\005\"\220\001\n\016GetColumnsResp\022(\n\006statu" +
- "s\030\001 \001(\0162\030.exec.user.RequestStatus\022*\n\007col" +
- "umns\030\002 \003(\0132\031.exec.user.ColumnMetadata\022(\n" +
- "\005error\030\003 \001(\0132\031.exec.shared.DrillPBError\"" +
- "/\n\032CreatePreparedStatementReq\022\021\n\tsql_que" +
- "ry\030\001 \001(\t\"\326\003\n\024ResultColumnMetadata\022\024\n\014cat" +
- "alog_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\n" +
- "table_name\030\003 \001(\t\022\023\n\013column_name\030\004 \001(\t\022\r\n" +
- "\005label\030\005 \001(\t\022\021\n\tdata_type\030\006 \001(\t\022\023\n\013is_nu" +
- "llable\030\007 \001(\010\022\021\n\tprecision\030\010 \001(\005\022\r\n\005scale",
- "\030\t \001(\005\022\016\n\006signed\030\n \001(\010\022\024\n\014display_size\030\013" +
- " \001(\005\022\022\n\nis_aliased\030\014 \001(\010\0225\n\rsearchabilit" +
- "y\030\r \001(\0162\036.exec.user.ColumnSearchability\022" +
- "3\n\014updatability\030\016 \001(\0162\035.exec.user.Column" +
- "Updatability\022\026\n\016auto_increment\030\017 \001(\010\022\030\n\020" +
- "case_sensitivity\030\020 \001(\010\022\020\n\010sortable\030\021 \001(\010" +
- "\022\022\n\nclass_name\030\022 \001(\t\022\023\n\013is_currency\030\024 \001(" +
- "\010\".\n\027PreparedStatementHandle\022\023\n\013server_i" +
- "nfo\030\001 \001(\014\"\200\001\n\021PreparedStatement\0220\n\007colum" +
- "ns\030\001 \003(\0132\037.exec.user.ResultColumnMetadat",
- "a\0229\n\rserver_handle\030\002 \001(\0132\".exec.user.Pre" +
- "paredStatementHandle\"\253\001\n\033CreatePreparedS" +
- "tatementResp\022(\n\006status\030\001 \001(\0162\030.exec.user" +
- ".RequestStatus\0228\n\022prepared_statement\030\002 \001" +
- "(\0132\034.exec.user.PreparedStatement\022(\n\005erro" +
- "r\030\003 \001(\0132\031.exec.shared.DrillPBError\"\353\001\n\010R" +
- "unQuery\0221\n\014results_mode\030\001 \001(\0162\033.exec.use" +
- "r.QueryResultsMode\022$\n\004type\030\002 \001(\0162\026.exec." +
- "shared.QueryType\022\014\n\004plan\030\003 \001(\t\0221\n\tfragme" +
- "nts\030\004 \003(\0132\036.exec.bit.control.PlanFragmen",
- "t\022E\n\031prepared_statement_handle\030\005 \001(\0132\".e" +
- "xec.user.PreparedStatementHandle*\310\003\n\007Rpc" +
- "Type\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\017RE" +
- "QUEST_RESULTS\020\005\022\027\n\023RESUME_PAUSED_QUERY\020\013" +
- "\022\034\n\030GET_QUERY_PLAN_FRAGMENTS\020\014\022\020\n\014GET_CA" +
- "TALOGS\020\016\022\017\n\013GET_SCHEMAS\020\017\022\016\n\nGET_TABLES\020" +
- "\020\022\017\n\013GET_COLUMNS\020\021\022\035\n\031CREATE_PREPARED_ST" +
- "ATEMENT\020\026\022\016\n\nQUERY_DATA\020\006\022\020\n\014QUERY_HANDL" +
- "E\020\007\022\030\n\024QUERY_PLAN_FRAGMENTS\020\r\022\014\n\010CATALOG",
- "S\020\022\022\013\n\007SCHEMAS\020\023\022\n\n\006TABLES\020\024\022\013\n\007COLUMNS\020" +
- "\025\022\026\n\022PREPARED_STATEMENT\020\027\022\026\n\022REQ_META_FU" +
- "NCTIONS\020\010\022\026\n\022RESP_FUNCTION_LIST\020\t\022\020\n\014QUE" +
- "RY_RESULT\020\n*#\n\020QueryResultsMode\022\017\n\013STREA" +
- "M_FULL\020\001*^\n\017HandshakeStatus\022\013\n\007SUCCESS\020\001" +
- "\022\030\n\024RPC_VERSION_MISMATCH\020\002\022\017\n\013AUTH_FAILE" +
- "D\020\003\022\023\n\017UNKNOWN_FAILURE\020\004*D\n\rRequestStatu" +
- "s\022\022\n\016UNKNOWN_STATUS\020\000\022\006\n\002OK\020\001\022\n\n\006FAILED\020" +
- "\002\022\013\n\007TIMEOUT\020\003*Y\n\023ColumnSearchability\022\031\n" +
- "\025UNKNOWN_SEARCHABILITY\020\000\022\010\n\004NONE\020\001\022\010\n\004CH",
- "AR\020\002\022\n\n\006NUMBER\020\003\022\007\n\003ALL\020\004*K\n\022ColumnUpdat" +
- "ability\022\030\n\024UNKNOWN_UPDATABILITY\020\000\022\r\n\tREA" +
- "D_ONLY\020\001\022\014\n\010WRITABLE\020\002B+\n\033org.apache.dri" +
- "ll.exec.protoB\nUserProtosH\001"
+ "ec.user.Property\"\210\001\n\020RpcEndpointInfos\022\014\n" +
+ "\004name\030\001 \001(\t\022\017\n\007version\030\002 \001(\t\022\024\n\014majorVer" +
+ "sion\030\003 \001(\r\022\024\n\014minorVersion\030\004 \001(\r\022\024\n\014patc" +
+ "hVersion\030\005 \001(\r\022\023\n\013application\030\006 \001(\t\"\317\002\n\022" +
+ "UserToBitHandshake\022.\n\007channel\030\001 \001(\0162\027.ex",
+ "ec.shared.RpcChannel:\004USER\022\031\n\021support_li" +
+ "stening\030\002 \001(\010\022\023\n\013rpc_version\030\003 \001(\005\0221\n\013cr" +
+ "edentials\030\004 \001(\0132\034.exec.shared.UserCreden" +
+ "tials\022-\n\nproperties\030\005 \001(\0132\031.exec.user.Us" +
+ "erProperties\022$\n\025support_complex_types\030\006 " +
+ "\001(\010:\005false\022\036\n\017support_timeout\030\007 \001(\010:\005fal" +
+ "se\0221\n\014client_infos\030\010 \001(\0132\033.exec.user.Rpc" +
+ "EndpointInfos\"S\n\016RequestResults\022&\n\010query" +
+ "_id\030\001 \001(\0132\024.exec.shared.QueryId\022\031\n\021maxim" +
+ "um_responses\030\002 \001(\005\"g\n\025GetQueryPlanFragme",
+ "nts\022\r\n\005query\030\001 \002(\t\022$\n\004type\030\002 \001(\0162\026.exec." +
+ "shared.QueryType\022\031\n\nsplit_plan\030\003 \001(\010:\005fa" +
+ "lse\"\316\001\n\022QueryPlanFragments\0223\n\006status\030\001 \002" +
+ "(\0162#.exec.shared.QueryResult.QueryState\022" +
+ "&\n\010query_id\030\002 \001(\0132\024.exec.shared.QueryId\022" +
+ "1\n\tfragments\030\003 \003(\0132\036.exec.bit.control.Pl" +
+ "anFragment\022(\n\005error\030\004 \001(\0132\031.exec.shared." +
+ "DrillPBError\"\257\001\n\022BitToUserHandshake\022\023\n\013r" +
+ "pc_version\030\002 \001(\005\022*\n\006status\030\003 \001(\0162\032.exec." +
+ "user.HandshakeStatus\022\017\n\007errorId\030\004 \001(\t\022\024\n",
+ "\014errorMessage\030\005 \001(\t\0221\n\014server_infos\030\006 \001(" +
+ "\0132\033.exec.user.RpcEndpointInfos\"-\n\nLikeFi" +
+ "lter\022\017\n\007pattern\030\001 \001(\t\022\016\n\006escape\030\002 \001(\t\"D\n" +
+ "\016GetCatalogsReq\0222\n\023catalog_name_filter\030\001" +
+ " \001(\0132\025.exec.user.LikeFilter\"M\n\017CatalogMe" +
+ "tadata\022\024\n\014catalog_name\030\001 \001(\t\022\023\n\013descript" +
+ "ion\030\002 \001(\t\022\017\n\007connect\030\003 \001(\t\"\223\001\n\017GetCatalo" +
+ "gsResp\022(\n\006status\030\001 \001(\0162\030.exec.user.Reque" +
+ "stStatus\022,\n\010catalogs\030\002 \003(\0132\032.exec.user.C" +
+ "atalogMetadata\022(\n\005error\030\003 \001(\0132\031.exec.sha",
+ "red.DrillPBError\"v\n\rGetSchemasReq\0222\n\023cat" +
+ "alog_name_filter\030\001 \001(\0132\025.exec.user.LikeF" +
+ "ilter\0221\n\022schema_name_filter\030\002 \001(\0132\025.exec" +
+ ".user.LikeFilter\"i\n\016SchemaMetadata\022\024\n\014ca" +
+ "talog_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\r\n" +
+ "\005owner\030\003 \001(\t\022\014\n\004type\030\004 \001(\t\022\017\n\007mutable\030\005 " +
+ "\001(\t\"\220\001\n\016GetSchemasResp\022(\n\006status\030\001 \001(\0162\030" +
+ ".exec.user.RequestStatus\022*\n\007schemas\030\002 \003(" +
+ "\0132\031.exec.user.SchemaMetadata\022(\n\005error\030\003 " +
+ "\001(\0132\031.exec.shared.DrillPBError\"\302\001\n\014GetTa",
+ "blesReq\0222\n\023catalog_name_filter\030\001 \001(\0132\025.e" +
+ "xec.user.LikeFilter\0221\n\022schema_name_filte" +
+ "r\030\002 \001(\0132\025.exec.user.LikeFilter\0220\n\021table_" +
+ "name_filter\030\003 \001(\0132\025.exec.user.LikeFilter" +
+ "\022\031\n\021table_type_filter\030\004 \003(\t\"\\\n\rTableMeta" +
+ "data\022\024\n\014catalog_name\030\001 \001(\t\022\023\n\013schema_nam" +
+ "e\030\002 \001(\t\022\022\n\ntable_name\030\003 \001(\t\022\014\n\004type\030\004 \001(" +
+ "\t\"\215\001\n\rGetTablesResp\022(\n\006status\030\001 \001(\0162\030.ex" +
+ "ec.user.RequestStatus\022(\n\006tables\030\002 \003(\0132\030." +
+ "exec.user.TableMetadata\022(\n\005error\030\003 \001(\0132\031",
+ ".exec.shared.DrillPBError\"\333\001\n\rGetColumns" +
+ "Req\0222\n\023catalog_name_filter\030\001 \001(\0132\025.exec." +
+ "user.LikeFilter\0221\n\022schema_name_filter\030\002 " +
+ "\001(\0132\025.exec.user.LikeFilter\0220\n\021table_name" +
+ "_filter\030\003 \001(\0132\025.exec.user.LikeFilter\0221\n\022" +
+ "column_name_filter\030\004 \001(\0132\025.exec.user.Lik" +
+ "eFilter\"\224\003\n\016ColumnMetadata\022\024\n\014catalog_na" +
+ "me\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022\n\ntable_n" +
+ "ame\030\003 \001(\t\022\023\n\013column_name\030\004 \001(\t\022\030\n\020ordina" +
+ "l_position\030\005 \001(\005\022\025\n\rdefault_value\030\006 \001(\t\022",
+ "\023\n\013is_nullable\030\007 \001(\010\022\021\n\tdata_type\030\010 \001(\t\022" +
+ "\027\n\017char_max_length\030\t \001(\005\022\031\n\021char_octet_l" +
+ "ength\030\n \001(\005\022\031\n\021numeric_precision\030\013 \001(\005\022\037" +
+ "\n\027numeric_precision_radix\030\014 \001(\005\022\025\n\rnumer" +
+ "ic_scale\030\r \001(\005\022\033\n\023date_time_precision\030\016 " +
+ "\001(\005\022\025\n\rinterval_type\030\017 \001(\t\022\032\n\022interval_p" +
+ "recision\030\020 \001(\005\"\220\001\n\016GetColumnsResp\022(\n\006sta" +
+ "tus\030\001 \001(\0162\030.exec.user.RequestStatus\022*\n\007c" +
+ "olumns\030\002 \003(\0132\031.exec.user.ColumnMetadata\022" +
+ "(\n\005error\030\003 \001(\0132\031.exec.shared.DrillPBErro",
+ "r\"/\n\032CreatePreparedStatementReq\022\021\n\tsql_q" +
+ "uery\030\001 \001(\t\"\326\003\n\024ResultColumnMetadata\022\024\n\014c" +
+ "atalog_name\030\001 \001(\t\022\023\n\013schema_name\030\002 \001(\t\022\022" +
+ "\n\ntable_name\030\003 \001(\t\022\023\n\013column_name\030\004 \001(\t\022" +
+ "\r\n\005label\030\005 \001(\t\022\021\n\tdata_type\030\006 \001(\t\022\023\n\013is_" +
+ "nullable\030\007 \001(\010\022\021\n\tprecision\030\010 \001(\005\022\r\n\005sca" +
+ "le\030\t \001(\005\022\016\n\006signed\030\n \001(\010\022\024\n\014display_size" +
+ "\030\013 \001(\005\022\022\n\nis_aliased\030\014 \001(\010\0225\n\rsearchabil" +
+ "ity\030\r \001(\0162\036.exec.user.ColumnSearchabilit" +
+ "y\0223\n\014updatability\030\016 \001(\0162\035.exec.user.Colu",
+ "mnUpdatability\022\026\n\016auto_increment\030\017 \001(\010\022\030" +
+ "\n\020case_sensitivity\030\020 \001(\010\022\020\n\010sortable\030\021 \001" +
+ "(\010\022\022\n\nclass_name\030\022 \001(\t\022\023\n\013is_currency\030\024 " +
+ "\001(\010\".\n\027PreparedStatementHandle\022\023\n\013server" +
+ "_info\030\001 \001(\014\"\200\001\n\021PreparedStatement\0220\n\007col" +
+ "umns\030\001 \003(\0132\037.exec.user.ResultColumnMetad" +
+ "ata\0229\n\rserver_handle\030\002 \001(\0132\".exec.user.P" +
+ "reparedStatementHandle\"\253\001\n\033CreatePrepare" +
+ "dStatementResp\022(\n\006status\030\001 \001(\0162\030.exec.us" +
+ "er.RequestStatus\0228\n\022prepared_statement\030\002",
+ " \001(\0132\034.exec.user.PreparedStatement\022(\n\005er" +
+ "ror\030\003 \001(\0132\031.exec.shared.DrillPBError\"\353\001\n" +
+ "\010RunQuery\0221\n\014results_mode\030\001 \001(\0162\033.exec.u" +
+ "ser.QueryResultsMode\022$\n\004type\030\002 \001(\0162\026.exe" +
+ "c.shared.QueryType\022\014\n\004plan\030\003 \001(\t\0221\n\tfrag" +
+ "ments\030\004 \003(\0132\036.exec.bit.control.PlanFragm" +
+ "ent\022E\n\031prepared_statement_handle\030\005 \001(\0132\"" +
+ ".exec.user.PreparedStatementHandle*\310\003\n\007R" +
+ "pcType\022\r\n\tHANDSHAKE\020\000\022\007\n\003ACK\020\001\022\013\n\007GOODBY" +
+ "E\020\002\022\r\n\tRUN_QUERY\020\003\022\020\n\014CANCEL_QUERY\020\004\022\023\n\017",
+ "REQUEST_RESULTS\020\005\022\027\n\023RESUME_PAUSED_QUERY" +
+ "\020\013\022\034\n\030GET_QUERY_PLAN_FRAGMENTS\020\014\022\020\n\014GET_" +
+ "CATALOGS\020\016\022\017\n\013GET_SCHEMAS\020\017\022\016\n\nGET_TABLE" +
+ "S\020\020\022\017\n\013GET_COLUMNS\020\021\022\035\n\031CREATE_PREPARED_" +
+ "STATEMENT\020\026\022\016\n\nQUERY_DATA\020\006\022\020\n\014QUERY_HAN" +
+ "DLE\020\007\022\030\n\024QUERY_PLAN_FRAGMENTS\020\r\022\014\n\010CATAL" +
+ "OGS\020\022\022\013\n\007SCHEMAS\020\023\022\n\n\006TABLES\020\024\022\013\n\007COLUMN" +
+ "S\020\025\022\026\n\022PREPARED_STATEMENT\020\027\022\026\n\022REQ_META_" +
+ "FUNCTIONS\020\010\022\026\n\022RESP_FUNCTION_LIST\020\t\022\020\n\014Q" +
+ "UERY_RESULT\020\n*#\n\020QueryResultsMode\022\017\n\013STR",
+ "EAM_FULL\020\001*^\n\017HandshakeStatus\022\013\n\007SUCCESS" +
+ "\020\001\022\030\n\024RPC_VERSION_MISMATCH\020\002\022\017\n\013AUTH_FAI" +
+ "LED\020\003\022\023\n\017UNKNOWN_FAILURE\020\004*D\n\rRequestSta" +
+ "tus\022\022\n\016UNKNOWN_STATUS\020\000\022\006\n\002OK\020\001\022\n\n\006FAILE" +
+ "D\020\002\022\013\n\007TIMEOUT\020\003*Y\n\023ColumnSearchability\022" +
+ "\031\n\025UNKNOWN_SEARCHABILITY\020\000\022\010\n\004NONE\020\001\022\010\n\004" +
+ "CHAR\020\002\022\n\n\006NUMBER\020\003\022\007\n\003ALL\020\004*K\n\022ColumnUpd" +
+ "atability\022\030\n\024UNKNOWN_UPDATABILITY\020\000\022\r\n\tR" +
+ "EAD_ONLY\020\001\022\014\n\010WRITABLE\020\002B+\n\033org.apache.d" +
+ "rill.exec.protoB\nUserProtosH\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -27588,146 +29249,152 @@ public final class UserProtos {
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_UserProperties_descriptor,
new java.lang.String[] { "Properties", });
- internal_static_exec_user_UserToBitHandshake_descriptor =
+ internal_static_exec_user_RpcEndpointInfos_descriptor =
getDescriptor().getMessageTypes().get(2);
+ internal_static_exec_user_RpcEndpointInfos_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_exec_user_RpcEndpointInfos_descriptor,
+ new java.lang.String[] { "Name", "Version", "MajorVersion", "MinorVersion", "PatchVersion", "Application", });
+ internal_static_exec_user_UserToBitHandshake_descriptor =
+ getDescriptor().getMessageTypes().get(3);
internal_static_exec_user_UserToBitHandshake_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_UserToBitHandshake_descriptor,
- new java.lang.String[] { "Channel", "SupportListening", "RpcVersion", "Credentials", "Properties", "SupportComplexTypes", "SupportTimeout", });
+ new java.lang.String[] { "Channel", "SupportListening", "RpcVersion", "Credentials", "Properties", "SupportComplexTypes", "SupportTimeout", "ClientInfos", });
internal_static_exec_user_RequestResults_descriptor =
- getDescriptor().getMessageTypes().get(3);
+ getDescriptor().getMessageTypes().get(4);
internal_static_exec_user_RequestResults_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_RequestResults_descriptor,
new java.lang.String[] { "QueryId", "MaximumResponses", });
internal_static_exec_user_GetQueryPlanFragments_descriptor =
- getDescriptor().getMessageTypes().get(4);
+ getDescriptor().getMessageTypes().get(5);
internal_static_exec_user_GetQueryPlanFragments_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetQueryPlanFragments_descriptor,
new java.lang.String[] { "Query", "Type", "SplitPlan", });
internal_static_exec_user_QueryPlanFragments_descriptor =
- getDescriptor().getMessageTypes().get(5);
+ getDescriptor().getMessageTypes().get(6);
internal_static_exec_user_QueryPlanFragments_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_QueryPlanFragments_descriptor,
new java.lang.String[] { "Status", "QueryId", "Fragments", "Error", });
internal_static_exec_user_BitToUserHandshake_descriptor =
- getDescriptor().getMessageTypes().get(6);
+ getDescriptor().getMessageTypes().get(7);
internal_static_exec_user_BitToUserHandshake_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_BitToUserHandshake_descriptor,
- new java.lang.String[] { "RpcVersion", "Status", "ErrorId", "ErrorMessage", });
+ new java.lang.String[] { "RpcVersion", "Status", "ErrorId", "ErrorMessage", "ServerInfos", });
internal_static_exec_user_LikeFilter_descriptor =
- getDescriptor().getMessageTypes().get(7);
+ getDescriptor().getMessageTypes().get(8);
internal_static_exec_user_LikeFilter_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_LikeFilter_descriptor,
new java.lang.String[] { "Pattern", "Escape", });
internal_static_exec_user_GetCatalogsReq_descriptor =
- getDescriptor().getMessageTypes().get(8);
+ getDescriptor().getMessageTypes().get(9);
internal_static_exec_user_GetCatalogsReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetCatalogsReq_descriptor,
new java.lang.String[] { "CatalogNameFilter", });
internal_static_exec_user_CatalogMetadata_descriptor =
- getDescriptor().getMessageTypes().get(9);
+ getDescriptor().getMessageTypes().get(10);
internal_static_exec_user_CatalogMetadata_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_CatalogMetadata_descriptor,
new java.lang.String[] { "CatalogName", "Description", "Connect", });
internal_static_exec_user_GetCatalogsResp_descriptor =
- getDescriptor().getMessageTypes().get(10);
+ getDescriptor().getMessageTypes().get(11);
internal_static_exec_user_GetCatalogsResp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetCatalogsResp_descriptor,
new java.lang.String[] { "Status", "Catalogs", "Error", });
internal_static_exec_user_GetSchemasReq_descriptor =
- getDescriptor().getMessageTypes().get(11);
+ getDescriptor().getMessageTypes().get(12);
internal_static_exec_user_GetSchemasReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetSchemasReq_descriptor,
new java.lang.String[] { "CatalogNameFilter", "SchemaNameFilter", });
internal_static_exec_user_SchemaMetadata_descriptor =
- getDescriptor().getMessageTypes().get(12);
+ getDescriptor().getMessageTypes().get(13);
internal_static_exec_user_SchemaMetadata_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_SchemaMetadata_descriptor,
new java.lang.String[] { "CatalogName", "SchemaName", "Owner", "Type", "Mutable", });
internal_static_exec_user_GetSchemasResp_descriptor =
- getDescriptor().getMessageTypes().get(13);
+ getDescriptor().getMessageTypes().get(14);
internal_static_exec_user_GetSchemasResp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetSchemasResp_descriptor,
new java.lang.String[] { "Status", "Schemas", "Error", });
internal_static_exec_user_GetTablesReq_descriptor =
- getDescriptor().getMessageTypes().get(14);
+ getDescriptor().getMessageTypes().get(15);
internal_static_exec_user_GetTablesReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetTablesReq_descriptor,
new java.lang.String[] { "CatalogNameFilter", "SchemaNameFilter", "TableNameFilter", "TableTypeFilter", });
internal_static_exec_user_TableMetadata_descriptor =
- getDescriptor().getMessageTypes().get(15);
+ getDescriptor().getMessageTypes().get(16);
internal_static_exec_user_TableMetadata_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_TableMetadata_descriptor,
new java.lang.String[] { "CatalogName", "SchemaName", "TableName", "Type", });
internal_static_exec_user_GetTablesResp_descriptor =
- getDescriptor().getMessageTypes().get(16);
+ getDescriptor().getMessageTypes().get(17);
internal_static_exec_user_GetTablesResp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetTablesResp_descriptor,
new java.lang.String[] { "Status", "Tables", "Error", });
internal_static_exec_user_GetColumnsReq_descriptor =
- getDescriptor().getMessageTypes().get(17);
+ getDescriptor().getMessageTypes().get(18);
internal_static_exec_user_GetColumnsReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_exec_user_GetColumnsReq_descriptor,
new java.lang.String[] { "CatalogNameFilter", "SchemaNameFilter", "TableNameFilter", "ColumnNameFilter", });
internal_static_exec_user_ColumnMetadata_descriptor =
- getDescriptor().getMessageTypes().get(18);
+ getDescriptor().getMessageTy
<TRUNCATED>
[3/3] drill git commit: DRILL-4369: Exchange name and version infos
during handshake
Posted by ad...@apache.org.
DRILL-4369: Exchange name and version infos during handshake
There's no name and version exchanged between client and server over the User RPC
channel.
On client side, having access to the server name and version is useful to expose it
to the user (through JDBC or ODBC api like DatabaseMetadata#getDatabaseProductVersion()),
or to implement fallback strategy when some recent API are not available (like
metadata API).
On the server side, having access to the client version might be useful for audit
purposes and eventually to implement fallback strategy if it doesn't require a RPC
version change.
this closes #622
Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/13f21e14
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/13f21e14
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/13f21e14
Branch: refs/heads/master
Commit: 13f21e14b4f0832abba8e5632d8fa4e7a6a27635
Parents: db48298
Author: Laurent Goujon <la...@dremio.com>
Authored: Tue Oct 18 15:01:38 2016 -0700
Committer: adeneche <ad...@dremio.com>
Committed: Wed Oct 19 15:51:58 2016 -0700
----------------------------------------------------------------------
.../org/apache/drill/version/Generator.java | 90 -
.../codegen/templates/DrillVersionInfo.java | 79 +
.../apache/drill/exec/client/DrillClient.java | 37 +-
.../apache/drill/exec/rpc/user/UserClient.java | 25 +-
.../drill/exec/rpc/user/UserRpcUtils.java | 59 +
.../apache/drill/exec/rpc/user/UserServer.java | 20 +-
.../org/apache/drill/jdbc/ITTestShadedJar.java | 30 +
exec/jdbc/pom.xml | 6 +
.../drill/jdbc/impl/DrillConnectionImpl.java | 9 +-
.../jdbc/impl/DrillDatabaseMetaDataImpl.java | 29 +-
.../org/apache/drill/jdbc/impl/DriverImpl.java | 3 +-
.../main/resources/apache-drill-jdbc.properties | 21 +
.../java/org/apache/drill/jdbc/DriverTest.java | 34 +-
exec/vector/pom.xml | 22 -
.../drill/exec/proto/SchemaUserProtos.java | 164 ++
.../org/apache/drill/exec/proto/UserProtos.java | 1959 ++++++++++++++++--
.../exec/proto/beans/BitToUserHandshake.java | 24 +
.../exec/proto/beans/RpcEndpointInfos.java | 273 +++
.../exec/proto/beans/UserToBitHandshake.java | 24 +
protocol/src/main/protobuf/User.proto | 11 +
.../org/apache/drill/fmpp/mojo/FMPPMojo.java | 19 +-
.../apache/drill/fmpp/mojo/MavenDataLoader.java | 55 +
22 files changed, 2695 insertions(+), 298 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/common/src/main/java/org/apache/drill/version/Generator.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/version/Generator.java b/common/src/main/java/org/apache/drill/version/Generator.java
deleted file mode 100644
index 66607ed..0000000
--- a/common/src/main/java/org/apache/drill/version/Generator.java
+++ /dev/null
@@ -1,90 +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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.version;
-
-import com.google.common.base.Preconditions;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-/**
- * This class is called from the exec->vector module using Maven-exec.
- * To make use of the class, it needs to be compiled in an earlier module.
- * For the configuration see the pom.xml file in that module.
- */
-public class Generator {
-
- public static void main(String[] args) {
- String toReplace = "REPLACE_WITH_DRILL_VERSION";
- String template =
- "/**\n" +
- " * Licensed to the Apache Software Foundation (ASF) under one\n" +
- " * or more contributor license agreements. See the NOTICE file\n" +
- " * distributed with this work for additional information\n" +
- " * regarding copyright ownership. The ASF licenses this file\n" +
- " * to you under the Apache License, Version 2.0 (the\n" +
- " * \"License\"); you may not use this file except in compliance\n" +
- " * with the License. You may obtain a copy of the License at\n" +
- " *\n" +
- " * http://www.apache.org/licenses/LICENSE-2.0\n" +
- " *\n" +
- " * Unless required by applicable law or agreed to in writing, software\n" +
- " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
- " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
- " * See the License for the specific language governing permissions and\n" +
- " * limitations under the License.\n" +
- " */\n" +
- "package org.apache.drill.common.util;\n" +
- "\n" +
- "/**\n" +
- " * Get access to the Drill Version\n" +
- " */\n" +
- "// File generated during build, DO NOT EDIT!!\n" +
- "public class DrillVersionInfo {\n" +
- "\n" +
- " /**\n" +
- " * Get the Drill version from the Manifest file\n" +
- " * @return the version number as x.y.z\n" +
- " */\n" +
- " public static String getVersion() {\n" +
- " return \"" + toReplace + "\";\n" +
- " }\n" +
- "}\n";
- Preconditions.checkArgument(args.length == 2,
- "Two arguments expected, the first is the target java source directory for the generated file" +
- " and the second is the Drill version.");
- File srcFile = new File(args[0] + "/org/apache/drill/common/util/DrillVersionInfo.java");
- srcFile = srcFile.getAbsoluteFile();
- File parent = srcFile.getParentFile();
- if (!parent.exists()) {
- if (!parent.mkdirs()) {
- throw new RuntimeException("Error generating Drill version info class. Couldn't mkdirs for " + parent);
- }
- }
- final FileWriter writer;
- try {
- writer = new FileWriter(srcFile);
- writer.write(template.replace(toReplace, args[1]));
- writer.close();
- } catch (IOException e) {
- throw new RuntimeException("Error generating Drill version info class. " +
- "Couldn't open source file for writing: " + srcFile);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/java-exec/src/main/codegen/templates/DrillVersionInfo.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/templates/DrillVersionInfo.java b/exec/java-exec/src/main/codegen/templates/DrillVersionInfo.java
new file mode 100644
index 0000000..7b4b222
--- /dev/null
+++ b/exec/java-exec/src/main/codegen/templates/DrillVersionInfo.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+
+<@pp.dropOutputFile />
+
+<@pp.changeOutputFile name="/org/apache/drill/common/util/DrillVersionInfo.java" />
+
+<#include "/@includes/license.ftl" />
+
+package org.apache.drill.common.util;
+
+import java.text.MessageFormat;
+import java.text.ParseException;
+
+/*
+ * This file is generated with Freemarker using the template src/main/codegen/templates/DrillVersionInfo.java
+ */
+/**
+ * Give access to Drill version as captured during the build
+ *
+ * <strong>Caution</strong> don't rely on major, minor and patch versions only to compare two
+ * Drill versions. Instead you should use the whole string, and apply the same semver algorithm
+ * as Maven (see {@code org.apache.maven.artifact.versioning.ComparableVersion}).
+ *
+ */
+public class DrillVersionInfo {
+ private static final String VERSION = "${maven.project.version}";
+
+ private static final int MAJOR_VERSION = ${maven.project.artifact.selectedVersion.majorVersion};
+ private static final int MINOR_VERSION = ${maven.project.artifact.selectedVersion.minorVersion};
+ private static final int PATCH_VERSION = ${maven.project.artifact.selectedVersion.incrementalVersion};
+
+ /**
+ * Get the Drill version from pom
+ * @return the version number as x.y.z
+ */
+ public static String getVersion() {
+ return VERSION;
+ }
+
+ /**
+ * Get the Drill major version from pom
+ * @return x if assuming the version number is x.y.z
+ */
+ public static int getMajorVersion() {
+ return MAJOR_VERSION;
+ }
+
+ /**
+ * Get the Drill minor version from pom
+ * @return y if assuming the version number is x.y.z
+ */
+ public static int getMinorVersion() {
+ return MINOR_VERSION;
+ }
+
+ /**
+ * Get the Drill patch version from pom
+ * @return z if assuming the version number is x.y.z(-suffix)
+ */
+ public static int getPatchVersion() {
+ return PATCH_VERSION;
+ }
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
index 2c5cb47..297ccf1 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillClient.java
@@ -18,6 +18,7 @@
package org.apache.drill.exec.client;
import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static org.apache.drill.exec.proto.UserProtos.QueryResultsMode.STREAM_FULL;
import static org.apache.drill.exec.proto.UserProtos.RunQuery.newBuilder;
@@ -66,6 +67,7 @@ import org.apache.drill.exec.proto.UserProtos.LikeFilter;
import org.apache.drill.exec.proto.UserProtos.PreparedStatementHandle;
import org.apache.drill.exec.proto.UserProtos.Property;
import org.apache.drill.exec.proto.UserProtos.QueryPlanFragments;
+import org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos;
import org.apache.drill.exec.proto.UserProtos.RpcType;
import org.apache.drill.exec.proto.UserProtos.RunQuery;
import org.apache.drill.exec.proto.UserProtos.UserProperties;
@@ -98,6 +100,8 @@ import io.netty.channel.EventLoopGroup;
* String into ByteBuf.
*/
public class DrillClient implements Closeable, ConnectionThrottle {
+ public static final String DEFAULT_CLIENT_NAME = "Apache Drill Java client";
+
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillClient.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
@@ -115,6 +119,7 @@ public class DrillClient implements Closeable, ConnectionThrottle {
private final boolean isDirectConnection; // true if the connection bypasses zookeeper and connects directly to a drillbit
private EventLoopGroup eventLoopGroup;
private ExecutorService executor;
+ private String clientName = DEFAULT_CLIENT_NAME;
public DrillClient() throws OutOfMemoryException {
this(DrillConfig.create(), false);
@@ -176,6 +181,23 @@ public class DrillClient implements Closeable, ConnectionThrottle {
}
/**
+ * Sets the client name.
+ *
+ * If not set, default is {@code DrillClient#DEFAULT_CLIENT_NAME}.
+ *
+ * @param name the client name
+ *
+ * @throws IllegalStateException if called after a connection has been established.
+ * @throws NullPointerException if client name is null
+ */
+ public void setClientName(String name) {
+ if (connected) {
+ throw new IllegalStateException("Attempted to modify client connection property after connection has been established.");
+ }
+ this.clientName = checkNotNull(name, "client name should not be null");
+ }
+
+ /**
* Sets whether the application is willing to accept complex types (Map, Arrays) in the returned result set.
* Default is {@code true}. If set to {@code false}, the complex types are returned as JSON encoded VARCHAR type.
*
@@ -252,7 +274,7 @@ public class DrillClient implements Closeable, ConnectionThrottle {
super.afterExecute(r, t);
}
};
- client = new UserClient(config, supportComplexTypes, allocator, eventLoopGroup, executor);
+ client = new UserClient(clientName, config, supportComplexTypes, allocator, eventLoopGroup, executor);
logger.debug("Connecting to server {}:{}", endpoint.getAddress(), endpoint.getUserPort());
connect(endpoint);
connected = true;
@@ -330,6 +352,19 @@ public class DrillClient implements Closeable, ConnectionThrottle {
connected = false;
}
+
+ /**
+ * Return the server infos. Only available after connecting
+ *
+ * The result might be null if the server doesn't provide the informations.
+ *
+ * @return the server informations, or null if not connected or if the server
+ * doesn't provide the information
+ */
+ public RpcEndpointInfos getServerInfos() {
+ return client != null ? client.getServerInfos() : null;
+ }
+
/**
* Submits a string based query plan for execution and returns the result batches. Supported query types are:
* <p><ul>
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserClient.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserClient.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserClient.java
index c89ed0c..e6e62fc 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserClient.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserClient.java
@@ -17,9 +17,6 @@
*/
package org.apache.drill.exec.rpc.user;
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.EventLoopGroup;
-
import java.util.concurrent.Executor;
import org.apache.drill.common.config.DrillConfig;
@@ -39,6 +36,7 @@ import org.apache.drill.exec.proto.UserProtos.GetSchemasResp;
import org.apache.drill.exec.proto.UserProtos.GetTablesResp;
import org.apache.drill.exec.proto.UserProtos.HandshakeStatus;
import org.apache.drill.exec.proto.UserProtos.QueryPlanFragments;
+import org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos;
import org.apache.drill.exec.proto.UserProtos.RpcType;
import org.apache.drill.exec.proto.UserProtos.RunQuery;
import org.apache.drill.exec.proto.UserProtos.UserProperties;
@@ -55,14 +53,20 @@ import org.apache.drill.exec.rpc.RpcException;
import com.google.protobuf.MessageLite;
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.EventLoopGroup;
+
public class UserClient extends BasicClientWithConnection<RpcType, UserToBitHandshake, BitToUserHandshake> {
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(UserClient.class);
private final QueryResultHandler queryResultHandler = new QueryResultHandler();
+ private final String clientName;
+ private RpcEndpointInfos serverInfos = null;
+
private boolean supportComplexTypes = true;
- public UserClient(DrillConfig config, boolean supportComplexTypes, BufferAllocator alloc,
- EventLoopGroup eventLoopGroup, Executor eventExecutor) {
+ public UserClient(String clientName, DrillConfig config, boolean supportComplexTypes,
+ BufferAllocator alloc, EventLoopGroup eventLoopGroup, Executor eventExecutor) {
super(
UserRpcConfig.getMapping(config, eventExecutor),
alloc,
@@ -71,9 +75,14 @@ public class UserClient extends BasicClientWithConnection<RpcType, UserToBitHand
BitToUserHandshake.class,
BitToUserHandshake.PARSER,
"user client");
+ this.clientName = clientName;
this.supportComplexTypes = supportComplexTypes;
}
+ public RpcEndpointInfos getServerInfos() {
+ return serverInfos;
+ }
+
public void submitQuery(UserResultsListener resultsListener, RunQuery query) {
send(queryResultHandler.getWrappedListener(resultsListener), RpcType.RUN_QUERY, query, QueryId.class);
}
@@ -85,7 +94,8 @@ public class UserClient extends BasicClientWithConnection<RpcType, UserToBitHand
.setSupportListening(true)
.setSupportComplexTypes(supportComplexTypes)
.setSupportTimeout(true)
- .setCredentials(credentials);
+ .setCredentials(credentials)
+ .setClientInfos(UserRpcUtils.getRpcEndpointInfos(clientName));
if (props != null) {
hsBuilder.setProperties(props);
@@ -141,6 +151,9 @@ public class UserClient extends BasicClientWithConnection<RpcType, UserToBitHand
@Override
protected void validateHandshake(BitToUserHandshake inbound) throws RpcException {
// logger.debug("Handling handshake from bit to user. {}", inbound);
+ if (inbound.hasServerInfos()) {
+ serverInfos = inbound.getServerInfos();
+ }
if (inbound.getStatus() != HandshakeStatus.SUCCESS) {
final String errMsg = String.format("Status: %s, Error Id: %s, Error message: %s",
inbound.getStatus(), inbound.getErrorId(), inbound.getErrorMessage());
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserRpcUtils.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserRpcUtils.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserRpcUtils.java
new file mode 100644
index 0000000..e7e9ffd
--- /dev/null
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserRpcUtils.java
@@ -0,0 +1,59 @@
+/*
+ * 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.rpc.user;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+
+import org.apache.drill.common.util.DrillVersionInfo;
+import org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * Utility class for User RPC
+ *
+ */
+public final class UserRpcUtils {
+ private UserRpcUtils() {}
+
+ /**
+ * Returns a {@code RpcEndpointInfos} instance
+ *
+ * The instance is populated based on Drill version informations
+ * from the classpath and runtime information for the application
+ * name.
+ *
+ * @param name the endpoint name.
+ * @return a {@code RpcEndpointInfos} instance
+ * @throws NullPointerException if name is null
+ */
+ public static RpcEndpointInfos getRpcEndpointInfos(String name) {
+ RuntimeMXBean mxBean = ManagementFactory.getRuntimeMXBean();
+ RpcEndpointInfos infos = RpcEndpointInfos.newBuilder()
+ .setName(Preconditions.checkNotNull(name))
+ .setApplication(mxBean.getName())
+ .setVersion(DrillVersionInfo.getVersion())
+ .setMajorVersion(DrillVersionInfo.getMajorVersion())
+ .setMinorVersion(DrillVersionInfo.getMinorVersion())
+ .setPatchVersion(DrillVersionInfo.getPatchVersion())
+ .build();
+
+ return infos;
+ }
+}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserServer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserServer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserServer.java
index 9a15d96..4e17249 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserServer.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserServer.java
@@ -17,14 +17,6 @@
*/
package org.apache.drill.exec.rpc.user;
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufInputStream;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.socket.SocketChannel;
-
import java.io.IOException;
import java.net.SocketAddress;
import java.util.UUID;
@@ -71,8 +63,16 @@ import org.apache.drill.exec.work.user.UserWorker;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.MessageLite;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.ByteBufInputStream;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+
public class UserServer extends BasicServer<RpcType, UserClientConnectionImpl> {
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(UserServer.class);
+ private static final String SERVER_NAME = "Apache Drill Server";
final UserWorker worker;
final BufferAllocator alloc;
@@ -336,7 +336,8 @@ public class UserServer extends BasicServer<RpcType, UserClientConnectionImpl> {
}
BitToUserHandshake.Builder respBuilder = BitToUserHandshake.newBuilder()
- .setRpcVersion(UserRpcConfig.RPC_VERSION);
+ .setRpcVersion(UserRpcConfig.RPC_VERSION)
+ .setServerInfos(UserRpcUtils.getRpcEndpointInfos(SERVER_NAME));
try {
if (inbound.getRpcVersion() != UserRpcConfig.RPC_VERSION) {
@@ -364,7 +365,6 @@ public class UserServer extends BasicServer<RpcType, UserClientConnectionImpl> {
}
connection.setUser(inbound);
-
return respBuilder.setStatus(HandshakeStatus.SUCCESS).build();
} catch (Exception e) {
return handleFailure(respBuilder, HandshakeStatus.UNKNOWN_FAILURE, e.getMessage(), e);
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc-all/src/test/java/org/apache/drill/jdbc/ITTestShadedJar.java
----------------------------------------------------------------------
diff --git a/exec/jdbc-all/src/test/java/org/apache/drill/jdbc/ITTestShadedJar.java b/exec/jdbc-all/src/test/java/org/apache/drill/jdbc/ITTestShadedJar.java
index f64b5b7..faad62a 100644
--- a/exec/jdbc-all/src/test/java/org/apache/drill/jdbc/ITTestShadedJar.java
+++ b/exec/jdbc-all/src/test/java/org/apache/drill/jdbc/ITTestShadedJar.java
@@ -17,6 +17,8 @@
*/
package org.apache.drill.jdbc;
+import static org.junit.Assert.assertEquals;
+
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -25,6 +27,7 @@ import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Paths;
import java.sql.Connection;
+import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
@@ -67,6 +70,33 @@ public class ITTestShadedJar {
}
@Test
+ public void testDatabaseVersion() throws Exception {
+
+ // print class path for debugging
+ System.out.println("java.class.path:");
+ System.out.println(System.getProperty("java.class.path"));
+
+ final URLClassLoader loader = (URLClassLoader) ClassLoader.getSystemClassLoader();
+ Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
+ method.setAccessible(true);
+ method.invoke(loader, getJdbcUrl());
+
+ Class<?> clazz = loader.loadClass("org.apache.drill.jdbc.Driver");
+ try {
+ Driver driver = (Driver) clazz.newInstance();
+ try (Connection c = driver.connect("jdbc:drill:drillbit=localhost:31010", null)) {
+ DatabaseMetaData metadata = c.getMetaData();
+ assertEquals("Apache Drill JDBC Driver", metadata.getDriverName());
+ assertEquals("Apache Drill Server", metadata.getDatabaseProductName());
+ //assertEquals()
+ }
+ } catch (Exception ex) {
+ throw ex;
+ }
+
+ }
+
+ @Test
public void executeJdbcAllQuery() throws Exception {
// print class path for debugging
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/exec/jdbc/pom.xml b/exec/jdbc/pom.xml
index b26ff6a..17dfc8f 100644
--- a/exec/jdbc/pom.xml
+++ b/exec/jdbc/pom.xml
@@ -103,6 +103,12 @@
</dependencies>
<build>
+ <resources>
+ <resource>
+ <directory>${project.basedir}/src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java
index 34b6094..680c27e 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java
@@ -96,6 +96,8 @@ class DrillConnectionImpl extends AvaticaConnection
this.config = new DrillConnectionConfig(info);
try {
+ String connect = null;
+
if (config.isLocal()) {
try {
Class.forName("org.eclipse.jetty.server.Handler");
@@ -133,12 +135,11 @@ class DrillConnectionImpl extends AvaticaConnection
makeTmpSchemaLocationsUnique(bit.getContext().getStorage(), info);
this.client = new DrillClient(dConfig, set.getCoordinator());
- this.client.connect(null, info);
} else if(config.isDirect()) {
final DrillConfig dConfig = DrillConfig.forClient();
this.allocator = RootAllocatorFactory.newRoot(dConfig);
this.client = new DrillClient(dConfig, true); // Get a direct connection
- this.client.connect(config.getZookeeperConnectionString(), info);
+ connect = config.getZookeeperConnectionString();
} else {
final DrillConfig dConfig = DrillConfig.forClient();
this.allocator = RootAllocatorFactory.newRoot(dConfig);
@@ -147,8 +148,10 @@ class DrillConnectionImpl extends AvaticaConnection
// implementations (needed by a server, but not by a client-only
// process, right?)? Probably pass dConfig to construction.
this.client = new DrillClient();
- this.client.connect(config.getZookeeperConnectionString(), info);
+ connect = config.getZookeeperConnectionString();
}
+ this.client.setClientName("Apache Drill JDBC Driver");
+ this.client.connect(connect, info);
} catch (OutOfMemoryException e) {
throw new SQLException("Failure creating root allocator", e);
} catch (RpcException e) {
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
index 91d4cae..43c6c21 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
@@ -26,6 +26,7 @@ import java.sql.SQLFeatureNotSupportedException;
import org.apache.calcite.avatica.AvaticaConnection;
import org.apache.calcite.avatica.AvaticaDatabaseMetaData;
+import org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos;
import org.apache.drill.jdbc.AlreadyClosedSqlException;
import org.apache.drill.jdbc.DrillDatabaseMetaData;
@@ -54,6 +55,10 @@ class DrillDatabaseMetaDataImpl extends AvaticaDatabaseMetaData
}
}
+ private RpcEndpointInfos getServerInfos() throws SQLException {
+ DrillConnectionImpl connection = (DrillConnectionImpl) getConnection();
+ return connection.getClient().getServerInfos();
+ }
// Note: Dynamic proxies could be used to reduce the quantity (450?) of
// method overrides by eliminating those that exist solely to check whether
@@ -125,13 +130,21 @@ class DrillDatabaseMetaDataImpl extends AvaticaDatabaseMetaData
@Override
public String getDatabaseProductName() throws SQLException {
throwIfClosed();
- return super.getDatabaseProductName();
+ RpcEndpointInfos infos = getServerInfos();
+ if (infos == null) {
+ return super.getDatabaseProductName();
+ }
+ return infos.getName();
}
@Override
public String getDatabaseProductVersion() throws SQLException {
throwIfClosed();
- return super.getDatabaseProductVersion();
+ RpcEndpointInfos infos = getServerInfos();
+ if (infos == null) {
+ return super.getDatabaseProductVersion();
+ }
+ return infos.getVersion();
}
@Override
@@ -1171,13 +1184,21 @@ class DrillDatabaseMetaDataImpl extends AvaticaDatabaseMetaData
@Override
public int getDatabaseMajorVersion() throws SQLException {
throwIfClosed();
- return super.getDatabaseMajorVersion();
+ RpcEndpointInfos infos = getServerInfos();
+ if (infos == null) {
+ return super.getDatabaseMajorVersion();
+ }
+ return infos.getMajorVersion();
}
@Override
public int getDatabaseMinorVersion() throws SQLException {
throwIfClosed();
- return super.getDatabaseMinorVersion();
+ RpcEndpointInfos infos = getServerInfos();
+ if (infos == null) {
+ return super.getDatabaseMinorVersion();
+ }
+ return infos.getMinorVersion();
}
@Override
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DriverImpl.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DriverImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DriverImpl.java
index 3377b6e..b06a534 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DriverImpl.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DriverImpl.java
@@ -22,6 +22,7 @@ import org.apache.calcite.avatica.DriverVersion;
import org.apache.calcite.avatica.Handler;
import org.apache.calcite.avatica.Meta;
import org.apache.calcite.avatica.UnregisteredDriver;
+import org.apache.drill.common.util.DrillVersionInfo;
/**
* Optiq JDBC driver.
@@ -62,7 +63,7 @@ public class DriverImpl extends UnregisteredDriver {
METADATA_PROPERTIES_RESOURCE_PATH,
// Driver name and version:
"Apache Drill JDBC Driver",
- "<Properties resource " + METADATA_PROPERTIES_RESOURCE_PATH + " not loaded>",
+ DrillVersionInfo.getVersion(),
// Database product name and version:
"Apache Drill",
"<Properties resource " + METADATA_PROPERTIES_RESOURCE_PATH + " not loaded>");
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc/src/main/resources/apache-drill-jdbc.properties
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/resources/apache-drill-jdbc.properties b/exec/jdbc/src/main/resources/apache-drill-jdbc.properties
new file mode 100644
index 0000000..c39094d
--- /dev/null
+++ b/exec/jdbc/src/main/resources/apache-drill-jdbc.properties
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+driver.name = Apache Drill JDBC Driver
+driver.version = ${project.version}
+driver.version.major = ${project.artifact.selectedVersion.majorVersion}
+driver.version.minor = ${project.artifact.selectedVersion.minorVersion}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/jdbc/src/test/java/org/apache/drill/jdbc/DriverTest.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/test/java/org/apache/drill/jdbc/DriverTest.java b/exec/jdbc/src/test/java/org/apache/drill/jdbc/DriverTest.java
index 7935215..efd0f6a 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/DriverTest.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/DriverTest.java
@@ -17,6 +17,15 @@
*/
package org.apache.drill.jdbc;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.instanceOf;
+//import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@@ -29,12 +38,7 @@ import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
-import static org.junit.Assert.*;
-//import static org.hamcrest.CoreMatchers.*;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.nullValue;
+import com.google.common.io.Resources;
/**
* (Some) unit and integration tests for org.apache.drill.jdbc.Driver.
@@ -202,18 +206,24 @@ public class DriverTest extends DrillTest {
// Tests for getMajorVersion() (defined by JDBC/java.sql.Driver):
- // TODO: Determine what major version number should be.
@Test
- public void test_getMajorVersion() {
- assertThat( uut.getMajorVersion(), org.hamcrest.CoreMatchers.is( 0 ) );
+ public void test_getMajorVersion() throws IOException {
+ Properties properties = new Properties();
+ properties.load(Resources.getResource("apache-drill-jdbc.properties").openStream());
+
+ assertThat( uut.getMajorVersion(),
+ org.hamcrest.CoreMatchers.is( Integer.parseInt(properties.getProperty("driver.version.major"))) );
}
// Tests for getMinorVersion() (defined by JDBC/java.sql.Driver):
- // TODO: Determine what minor version number should be.
@Test
- public void test_getMinorVersion() {
- assertThat( uut.getMinorVersion(), org.hamcrest.core.Is.is( 0 ) );
+ public void test_getMinorVersion() throws IOException {
+ Properties properties = new Properties();
+ properties.load(Resources.getResource("apache-drill-jdbc.properties").openStream());
+
+ assertThat( uut.getMinorVersion(),
+ org.hamcrest.CoreMatchers.is( Integer.parseInt(properties.getProperty("driver.version.minor"))) );
}
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/exec/vector/pom.xml
----------------------------------------------------------------------
diff --git a/exec/vector/pom.xml b/exec/vector/pom.xml
index 5e5e3ed..861ac79 100644
--- a/exec/vector/pom.xml
+++ b/exec/vector/pom.xml
@@ -120,28 +120,6 @@
</execution>
</executions>
</plugin>
- <plugin> <!-- generate class to provide current version number -->
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.2.1</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>org.apache.drill.version.Generator</mainClass>
- <includePluginDependencies>true</includePluginDependencies>
- <arguments>
- <argument>${basedir}/target/generated-sources</argument>
- <argument>${project.version}</argument>
- </arguments>
- <sourceRoot>${basedir}/target/generated-sources</sourceRoot>
- </configuration>
- </plugin>
</plugins>
<pluginManagement>
<plugins>
http://git-wip-us.apache.org/repos/asf/drill/blob/13f21e14/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserProtos.java
----------------------------------------------------------------------
diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserProtos.java b/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserProtos.java
index 891b1c9..9725741 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserProtos.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserProtos.java
@@ -255,6 +255,152 @@ public final class SchemaUserProtos
}
}
+ public static final class RpcEndpointInfos
+ {
+ public static final org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.MessageSchema WRITE =
+ new org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.MessageSchema();
+ public static final org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.BuilderSchema MERGE =
+ new org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.BuilderSchema();
+
+ public static class MessageSchema implements com.dyuproject.protostuff.Schema<org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos>
+ {
+ public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos message) throws java.io.IOException
+ {
+ if(message.hasName())
+ output.writeString(1, message.getName(), false);
+ if(message.hasVersion())
+ output.writeString(2, message.getVersion(), false);
+ if(message.hasMajorVersion())
+ output.writeUInt32(3, message.getMajorVersion(), false);
+ if(message.hasMinorVersion())
+ output.writeUInt32(4, message.getMinorVersion(), false);
+ if(message.hasPatchVersion())
+ output.writeUInt32(5, message.getPatchVersion(), false);
+ if(message.hasApplication())
+ output.writeString(6, message.getApplication(), false);
+ }
+ public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos message)
+ {
+ return message.isInitialized();
+ }
+ public java.lang.String getFieldName(int number)
+ {
+ return org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.getFieldName(number);
+ }
+ public int getFieldNumber(java.lang.String name)
+ {
+ return org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.getFieldNumber(name);
+ }
+ public java.lang.Class<org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos> typeClass()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class;
+ }
+ public java.lang.String messageName()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class.getSimpleName();
+ }
+ public java.lang.String messageFullName()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class.getName();
+ }
+ //unused
+ public void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos message) throws java.io.IOException {}
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos newMessage() { return null; }
+ }
+ public static class BuilderSchema implements com.dyuproject.protostuff.Schema<org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder>
+ {
+ public void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder builder) throws java.io.IOException
+ {
+ for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this))
+ {
+ switch(number)
+ {
+ case 0:
+ return;
+ case 1:
+ builder.setName(input.readString());
+ break;
+ case 2:
+ builder.setVersion(input.readString());
+ break;
+ case 3:
+ builder.setMajorVersion(input.readUInt32());
+ break;
+ case 4:
+ builder.setMinorVersion(input.readUInt32());
+ break;
+ case 5:
+ builder.setPatchVersion(input.readUInt32());
+ break;
+ case 6:
+ builder.setApplication(input.readString());
+ break;
+ default:
+ input.handleUnknownField(number, this);
+ }
+ }
+ }
+ public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder builder)
+ {
+ return builder.isInitialized();
+ }
+ public org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder newMessage()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder();
+ }
+ public java.lang.String getFieldName(int number)
+ {
+ return org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.getFieldName(number);
+ }
+ public int getFieldNumber(java.lang.String name)
+ {
+ return org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.getFieldNumber(name);
+ }
+ public java.lang.Class<org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder> typeClass()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder.class;
+ }
+ public java.lang.String messageName()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class.getSimpleName();
+ }
+ public java.lang.String messageFullName()
+ {
+ return org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.class.getName();
+ }
+ //unused
+ public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.Builder builder) throws java.io.IOException {}
+ }
+ public static java.lang.String getFieldName(int number)
+ {
+ switch(number)
+ {
+ case 1: return "name";
+ case 2: return "version";
+ case 3: return "majorVersion";
+ case 4: return "minorVersion";
+ case 5: return "patchVersion";
+ case 6: return "application";
+ default: return null;
+ }
+ }
+ public static int getFieldNumber(java.lang.String name)
+ {
+ java.lang.Integer number = fieldMap.get(name);
+ return number == null ? 0 : number.intValue();
+ }
+ private static final java.util.HashMap<java.lang.String,java.lang.Integer> fieldMap = new java.util.HashMap<java.lang.String,java.lang.Integer>();
+ static
+ {
+ fieldMap.put("name", 1);
+ fieldMap.put("version", 2);
+ fieldMap.put("majorVersion", 3);
+ fieldMap.put("minorVersion", 4);
+ fieldMap.put("patchVersion", 5);
+ fieldMap.put("application", 6);
+ }
+ }
+
public static final class UserToBitHandshake
{
public static final org.apache.drill.exec.proto.SchemaUserProtos.UserToBitHandshake.MessageSchema WRITE =
@@ -282,6 +428,9 @@ public final class SchemaUserProtos
output.writeBool(6, message.getSupportComplexTypes(), false);
if(message.hasSupportTimeout())
output.writeBool(7, message.getSupportTimeout(), false);
+ if(message.hasClientInfos())
+ output.writeObject(8, message.getClientInfos(), org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.WRITE, false);
+
}
public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.UserToBitHandshake message)
{
@@ -344,6 +493,10 @@ public final class SchemaUserProtos
case 7:
builder.setSupportTimeout(input.readBool());
break;
+ case 8:
+ builder.setClientInfos(input.mergeObject(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder(), org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.MERGE));
+
+ break;
default:
input.handleUnknownField(number, this);
}
@@ -391,6 +544,7 @@ public final class SchemaUserProtos
case 5: return "properties";
case 6: return "supportComplexTypes";
case 7: return "supportTimeout";
+ case 8: return "clientInfos";
default: return null;
}
}
@@ -409,6 +563,7 @@ public final class SchemaUserProtos
fieldMap.put("properties", 5);
fieldMap.put("supportComplexTypes", 6);
fieldMap.put("supportTimeout", 7);
+ fieldMap.put("clientInfos", 8);
}
}
@@ -814,6 +969,9 @@ public final class SchemaUserProtos
output.writeString(4, message.getErrorId(), false);
if(message.hasErrorMessage())
output.writeString(5, message.getErrorMessage(), false);
+ if(message.hasServerInfos())
+ output.writeObject(6, message.getServerInfos(), org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.WRITE, false);
+
}
public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.BitToUserHandshake message)
{
@@ -865,6 +1023,10 @@ public final class SchemaUserProtos
case 5:
builder.setErrorMessage(input.readString());
break;
+ case 6:
+ builder.setServerInfos(input.mergeObject(org.apache.drill.exec.proto.UserProtos.RpcEndpointInfos.newBuilder(), org.apache.drill.exec.proto.SchemaUserProtos.RpcEndpointInfos.MERGE));
+
+ break;
default:
input.handleUnknownField(number, this);
}
@@ -909,6 +1071,7 @@ public final class SchemaUserProtos
case 3: return "status";
case 4: return "errorId";
case 5: return "errorMessage";
+ case 6: return "serverInfos";
default: return null;
}
}
@@ -924,6 +1087,7 @@ public final class SchemaUserProtos
fieldMap.put("status", 3);
fieldMap.put("errorId", 4);
fieldMap.put("errorMessage", 5);
+ fieldMap.put("serverInfos", 6);
}
}