title: How to determine which Apache Drill drillbit was selected when connecting via zookeeper?
body: <p>I'm using a zookeeper connection string to get a connection to a drill cluster.  I would like to log which drillbit (hostname or IP address) I successfully connected to, but I can't find any property or method on the <a href="https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html" rel="nofollow noreferrer">java.sql.Connection class</a> to get this information.</p>
  <p>I tried <code>connection.getMetaData.getURL</code>, but that just returns the zookeeper connection string I used to get the connection (scala code below):</p>
  <pre class="lang-scala prettyprint-override"><code>import java.sql._
  Class.forName(&quot;com.mapr.drill.jdbc41.Driver&quot;)
  val con = DriverManager.getConnection(&quot;jdbc:drill:zk=&lt;server1&gt;:5181,&lt;server2&gt;:5181/drill/&lt;cluster_name&gt;...&quot;)
  con.getMetaData().getURL()  // returns &quot;jdbc:drill:zk=&lt;server1&gt;...&quot;
  val st  = con.createStatement()
  val res = st.executeQuery(&quot;select *,'findme' from sys.drillbits&quot;)
  while(res.next()) { println(res.getString(1)) }
  </code></pre>
  <p>If I grep the <code>drillbit_queries.json</code> logs on all of the drillbit servers for <code>findme</code>, I can find which drillbit was used to execute the query.  For tracking down connection issues, I'd like to be able to log which drillbit is being used from the application, rather than have to grep logfiles.</p>