.setRootCause(e).build().buildException(); if (this.connection.isClosed()) { // TODO: why the heck doesn't this throw above? throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_ESTABLISH_CONNECTION).build().buildException();
/** * Connection available. * * @return true, if successful */ private static boolean connectionAvailable() { if (clusterConnection == null) { System.out.println("clusterConnection=" + clusterConnection); return false; } System.out.println("clusterConnection.isClosed()=" + clusterConnection.isClosed()); return clusterConnection != null && !clusterConnection.isClosed(); }
/** * Creates an object to access a HBase table. * Shares zookeeper connection and other resources with other HTable instances * created with the same <code>connection</code> instance. * Use this constructor when the ExecutorService and HConnection instance are * externally managed. * @param tableName Name of the table. * @param connection HConnection to be used. * @param pool ExecutorService to be used. * @throws IOException if a remote or network exception occurs */ public HTable(final byte[] tableName, final HConnection connection, final ExecutorService pool) throws IOException { if (pool == null || pool.isShutdown()) { throw new IllegalArgumentException("Pool is null or shut down."); } if (connection == null || connection.isClosed()) { throw new IllegalArgumentException("Connection is null or closed."); } this.tableName = tableName; this.cleanupPoolOnClose = this.cleanupConnectionOnClose = false; this.connection = connection; this.configuration = connection.getConfiguration(); this.pool = pool; this.finishSetup(); }