void init(final Connection conn, final Scan scan) throws IOException { this.connection = Objects.requireNonNull(conn); this.table = this.connection.getTable(QuotaTableUtil.QUOTA_TABLE_NAME); try { scanner = table.getScanner(scan); } catch (IOException e) { try { close(); } catch (IOException ioe) { LOG.warn("Failed getting scanner and then failed close on cleanup", e); } throw e; } }
private int countResults(final QuotaFilter filter) throws Exception { QuotaRetriever scanner = QuotaRetriever.open(TEST_UTIL.getConfiguration(), filter); try { int count = 0; for (QuotaSettings settings: scanner) { LOG.debug(Objects.toString(settings)); count++; } return count; } finally { scanner.close(); } } }
/** * Returns the number of quotas defined in the HBase quota table. */ long listNumDefinedQuotas(Connection conn) throws IOException { QuotaRetriever scanner = QuotaRetriever.open(conn.getConfiguration()); try { return Iterables.size(scanner); } finally { if (scanner != null) { scanner.close(); } } }
scanner.close();
void init(final Connection conn, final Scan scan) throws IOException { this.connection = Objects.requireNonNull(conn); this.table = this.connection.getTable(QuotaTableUtil.QUOTA_TABLE_NAME); try { scanner = table.getScanner(scan); } catch (IOException e) { try { close(); } catch (IOException ioe) { LOG.warn("Failed getting scanner and then failed close on cleanup", e); } throw e; } }
assertSpaceQuota(originalSizeLimit, violationPolicy, Iterables.getOnlyElement(quotaScanner)); } finally { quotaScanner.close(); assertSpaceQuota(newSizeLimit, newViolationPolicy, Iterables.getOnlyElement(quotaScanner)); } finally { quotaScanner.close(); assertNull("Did not expect to find a quota entry", quotaScanner.next()); } finally { quotaScanner.close();
scanner.close();
void init(final Connection conn, final Scan scan) throws IOException { this.connection = Objects.requireNonNull(conn); this.table = this.connection.getTable(QuotaTableUtil.QUOTA_TABLE_NAME); try { scanner = table.getScanner(scan); } catch (IOException e) { try { close(); } catch (IOException ioe) { LOG.warn("Failed getting scanner and then failed close on cleanup", e); } throw e; } }
private int countResults(final QuotaFilter filter) throws Exception { QuotaRetriever scanner = QuotaRetriever.open(TEST_UTIL.getConfiguration(), filter); try { int count = 0; for (QuotaSettings settings: scanner) { LOG.debug(Objects.toString(settings)); count++; } return count; } finally { scanner.close(); } } }
void init(final Configuration conf, final Scan scan) throws IOException { this.connection = ConnectionFactory.createConnection(conf); this.table = this.connection.getTable(QuotaTableUtil.QUOTA_TABLE_NAME); try { scanner = table.getScanner(scan); } catch (IOException e) { try { close(); } catch (IOException ioe) { LOG.warn("Failed getting scanner and then failed close on cleanup", e); } throw e; } }
/** * Returns the number of quotas defined in the HBase quota table. */ long listNumDefinedQuotas(Connection conn) throws IOException { QuotaRetriever scanner = QuotaRetriever.open(conn.getConfiguration()); try { return Iterables.size(scanner); } finally { if (scanner != null) { scanner.close(); } } }
scanner.close();
assertSpaceQuota(originalSizeLimit, violationPolicy, Iterables.getOnlyElement(quotaScanner)); } finally { quotaScanner.close(); assertSpaceQuota(newSizeLimit, newViolationPolicy, Iterables.getOnlyElement(quotaScanner)); } finally { quotaScanner.close(); assertNull("Did not expect to find a quota entry", quotaScanner.next()); } finally { quotaScanner.close();