drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adene...@apache.org
Subject [3/3] drill git commit: DRILL-4369: Exchange name and version infos during handshake
Date Wed, 19 Oct 2016 22:52:55 GMT
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 <laurent@dremio.com>
Authored: Tue Oct 18 15:01:38 2016 -0700
Committer: adeneche <adeneche@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);
         }
     }
 


Mime
View raw message