@Override public void close() throws SQLException { if (iterators != null) { SQLCloseables.closeAll(iterators); } }
/** * Allows you to close as many of the {@link SQLCloseable}s as possible. * * If any of the close's fail with an IOException, those exception(s) will * be thrown after attempting to close all of the inputs. */ public static void closeAll(Iterable<? extends SQLCloseable> iterable) throws SQLException { SQLException ex = closeAllQuietly(iterable); if (ex != null) throw ex; }
@Override public void close() throws SQLException { try { SQLCloseables.closeAll(connectionQueryServicesMap.values()); } finally { connectionQueryServicesMap.clear(); } } }
try { if (!success) { SQLCloseables.closeAllQuietly(Collections.singletonList(hashCacheSpec)); for (Future<Boolean> future : futures) { future.cancel(true);
@Override public void close() throws SQLException { try { super.close(); } finally { SQLCloseables.closeAll(dependencies); } } };
} finally { if (!success) { SQLCloseables.closeAllQuietly(iterators);
private void closeStatements() throws SQLException { List<SQLCloseable> statements = this.statements; // create new list to prevent close of statements // from modifying this list. this.statements = Lists.newArrayList(); try { mutationState.rollback(this); } finally { try { SQLCloseables.closeAll(statements); } finally { statements.clear(); } } }
@Override public void close() throws SQLException { try { List<PhoenixResultSet> resultSets = this.resultSets; // Create new list so that remove of the PhoenixResultSet // during closeAll doesn't needless do a linear search // on this list. this.resultSets = Lists.newArrayList(); SQLCloseables.closeAll(resultSets); } finally { try { connection.removeStatement(this); } finally { isClosed = true; } } }