Java 类org.apache.hadoop.hbase.quotas.QuotaFilter 实例源码

项目:hbase    文件:TestAsyncQuotaAdminApi.java   
private int countResults(final QuotaFilter filter) throws Exception {
  int count = 0;
  for (QuotaSettings settings : admin.getQuota(filter).get()) {
    LOG.debug(Objects.toString(settings));
    count++;
  }
  return count;
}
项目:hbase    文件:HBaseAdmin.java   
@Override
public List<QuotaSettings> getQuota(QuotaFilter filter) throws IOException {
  List<QuotaSettings> quotas = new LinkedList<>();
  try (QuotaRetriever retriever = QuotaRetriever.open(conf, filter)) {
    Iterator<QuotaSettings> iterator = retriever.iterator();
    while (iterator.hasNext()) {
      quotas.add(iterator.next());
    }
  }
  return quotas;
}
项目:hbase    文件:RawAsyncHBaseAdmin.java   
@Override
public CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter) {
  CompletableFuture<List<QuotaSettings>> future = new CompletableFuture<>();
  Scan scan = QuotaTableUtil.makeScan(filter);
  this.connection.getTableBuilder(QuotaTableUtil.QUOTA_TABLE_NAME).build()
      .scan(scan, new AdvancedScanResultConsumer() {
        List<QuotaSettings> settings = new ArrayList<>();

        @Override
        public void onNext(Result[] results, ScanController controller) {
          for (Result result : results) {
            try {
              QuotaTableUtil.parseResultToCollection(result, settings);
            } catch (IOException e) {
              controller.terminate();
              future.completeExceptionally(e);
            }
          }
        }

        @Override
        public void onError(Throwable error) {
          future.completeExceptionally(error);
        }

        @Override
        public void onComplete() {
          future.complete(settings);
        }
      });
  return future;
}
项目:aliyun-tablestore-hbase-client    文件:TablestoreAdmin.java   
@Override
public QuotaRetriever getQuotaRetriever(QuotaFilter filter) throws IOException {
    throw new UnsupportedOperationException("getQuotaRetriever");
}
项目:ColumnManagerForHBase    文件:MAdmin.java   
@Override
public QuotaRetriever getQuotaRetriever(QuotaFilter qf) throws IOException {
  return wrappedHbaseAdmin.getQuotaRetriever(qf);
}
项目:hbase    文件:TestAsyncQuotaAdminApi.java   
private void assertNumResults(int expected, final QuotaFilter filter) throws Exception {
  assertEquals(expected, countResults(filter));
}
项目:hbase    文件:HBaseAdmin.java   
@Override
public QuotaRetriever getQuotaRetriever(final QuotaFilter filter) throws IOException {
  return QuotaRetriever.open(conf, filter);
}
项目:hbase    文件:AsyncHBaseAdmin.java   
@Override
public CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter) {
  return wrap(rawAdmin.getQuota(filter));
}
项目:ditb    文件:HBaseAdmin.java   
/**
 * Return a Quota Scanner to list the quotas based on the filter.
 * @param filter the quota settings filter
 * @return the quota scanner
 * @throws IOException if a remote or network exception occurs
 */
@Override
public QuotaRetriever getQuotaRetriever(final QuotaFilter filter) throws IOException {
  return QuotaRetriever.open(conf, filter);
}
项目:ditb    文件:Admin.java   
/**
 * Return a QuotaRetriever to list the quotas based on the filter.
 * @param filter the quota settings filter
 * @return the quota retriever
 * @throws IOException if a remote or network exception occurs
 */
QuotaRetriever getQuotaRetriever(final QuotaFilter filter) throws IOException;
项目:hbase    文件:Admin.java   
/**
 * Return a QuotaRetriever to list the quotas based on the filter.
 * @param filter the quota settings filter
 * @return the quota retriever
 * @throws IOException if a remote or network exception occurs
 * @deprecated Since 2.0.0. Will be removed in 3.0.0. Use {@link #getQuota(QuotaFilter)}.
 */
@Deprecated
QuotaRetriever getQuotaRetriever(QuotaFilter filter) throws IOException;
项目:hbase    文件:Admin.java   
/**
 * List the quotas based on the filter.
 * @param filter the quota settings filter
 * @return the QuotaSetting list
 * @throws IOException if a remote or network exception occurs
 */
List<QuotaSettings> getQuota(QuotaFilter filter) throws IOException;
项目:hbase    文件:AsyncAdmin.java   
/**
 * List the quotas based on the filter.
 * @param filter the quota settings filter
 * @return the QuotaSetting list, which wrapped by a CompletableFuture.
 */
CompletableFuture<List<QuotaSettings>> getQuota(QuotaFilter filter);