<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How many active connections are made to Hive metastore in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-many-active-connections-are-made-to-hive-metastore/m-p/19380#M12974</link>
    <description>&lt;P&gt;We are using an internal metastore implementation. ie the metastore is hosted at the Dataricks side. However, we believe the metastore instance made available for my workspace is not adequate enough to handle the load. How can I monitor the number of connections made from the clusters to the Hive metatore.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Jun 2021 17:09:52 GMT</pubDate>
    <dc:creator>brickster_2018</dc:creator>
    <dc:date>2021-06-25T17:09:52Z</dc:date>
    <item>
      <title>How many active connections are made to Hive metastore</title>
      <link>https://community.databricks.com/t5/data-engineering/how-many-active-connections-are-made-to-hive-metastore/m-p/19380#M12974</link>
      <description>&lt;P&gt;We are using an internal metastore implementation. ie the metastore is hosted at the Dataricks side. However, we believe the metastore instance made available for my workspace is not adequate enough to handle the load. How can I monitor the number of connections made from the clusters to the Hive metatore.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:09:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-many-active-connections-are-made-to-hive-metastore/m-p/19380#M12974</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-25T17:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: How many active connections are made to Hive metastore</title>
      <link>https://community.databricks.com/t5/data-engineering/how-many-active-connections-are-made-to-hive-metastore/m-p/19381#M12975</link>
      <description>&lt;P&gt;Use the below code snippet from a notebook&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%scala 
import java.sql.Connection
import java.sql.DriverManager
import java.sql.ResultSet
import java.sql.SQLException
&amp;nbsp;
/**
  * For details on what this query means, checkout &lt;A href="https://dev.mysql.com/doc/refman/8.0/en/processlist-table.html" target="test_blank"&gt;https://dev.mysql.com/doc/refman/8.0/en/processlist-table.html&lt;/A&gt;
**/
&amp;nbsp;
def printConnections: Unit = {
  val metastoreURL = spark.sparkContext.hadoopConfiguration.get("javax.jdo.option.ConnectionURL")
  val metastoreUser = spark.sparkContext.hadoopConfiguration.get("javax.jdo.option.ConnectionUserName")
  val metastorePassword = spark.sparkContext.hadoopConfiguration.get("javax.jdo.option.ConnectionPassword")
&amp;nbsp;
  val connection = DriverManager.getConnection(metastoreURL, metastoreUser, metastorePassword)
  val statement = connection.createStatement()
  val resultSet = statement.executeQuery("SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY Host")
&amp;nbsp;
  val rsmd = resultSet.getMetaData();
  val columnsNumber = rsmd.getColumnCount();
  (1 to columnsNumber).foreach { i =&amp;gt;
    print(rsmd.getColumnName(i) + "\t\t\t\t\t\t\t")
  }
  println();
  while (resultSet.next()) {
      var cumulativeLength = 0
      (1 to columnsNumber).foreach { i =&amp;gt;
          val data = if (resultSet.getString(i) != null) resultSet.getString(i).trim() else ""
          print(data + "\t\t\t\t\t\t");
      }
      println();
  }
  statement.close
  connection.close
}
&amp;nbsp;
printConnections&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 17:10:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-many-active-connections-are-made-to-hive-metastore/m-p/19381#M12975</guid>
      <dc:creator>brickster_2018</dc:creator>
      <dc:date>2021-06-25T17:10:36Z</dc:date>
    </item>
  </channel>
</rss>

