getMedianArgs(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false); final NavigableMap<byte[], List<S>> map = new TreeMap<>(Bytes.BYTES_COMPARATOR); class StdCallback implements Batch.Callback<List<S>> {
R min(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false); class MinCallBack implements Batch.Callback<R> { private R min = null;
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
long rowCount(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, true); class RowNumCallback implements Batch.Callback<Long> { private final AtomicLong rowCountL = new AtomicLong(0);
R max(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false); class MaxCallBack implements Batch.Callback<R> { R max = null;
S sum(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false);
Pair<S, Long> getAvgArgs(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false); class AvgCallBack implements Batch.Callback<Pair<S, Long>> { S sum = null;
Pair<List<S>, Long> getStdArgs(final Table table, final ColumnInterpreter<R, S, P, Q, T> ci, final Scan scan) throws Throwable { final AggregateRequest requestArg = validateArgAndGetPB(scan, ci, false); class StdCallback implements Batch.Callback<Pair<List<S>, Long>> { long rowCountVal = 0L;
public static <R, S, P extends Message, Q extends Message, T extends Message> CompletableFuture<Long> rowCount(AsyncTable<?> table, ColumnInterpreter<R, S, P, Q, T> ci, Scan scan) { CompletableFuture<Long> future = new CompletableFuture<>(); AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, true); } catch (IOException e) { future.completeExceptionally(e); return future; } AbstractAggregationCallback<Long> callback = new AbstractAggregationCallback<Long>(future) { private long count; @Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { count += resp.getFirstPart(0).asReadOnlyByteBuffer().getLong(); } @Override protected Long getFinalResult() { return count; } }; table .<AggregateService, AggregateResponse> coprocessorService(AggregateService::newStub, (stub, controller, rpcCallback) -> stub.getRowNum(controller, req, rpcCallback), callback) .fromRow(nullToEmpty(scan.getStartRow()), scan.includeStartRow()) .toRow(nullToEmpty(scan.getStopRow()), scan.includeStopRow()).execute(); return future; }
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
public static <R, S, P extends Message, Q extends Message, T extends Message> CompletableFuture<Long> rowCount(AsyncTable<?> table, ColumnInterpreter<R, S, P, Q, T> ci, Scan scan) { CompletableFuture<Long> future = new CompletableFuture<>(); AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, true); } catch (IOException e) { future.completeExceptionally(e); return future; } AbstractAggregationCallback<Long> callback = new AbstractAggregationCallback<Long>(future) { private long count; @Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { count += resp.getFirstPart(0).asReadOnlyByteBuffer().getLong(); } @Override protected Long getFinalResult() { return count; } }; table .<AggregateService, AggregateResponse> coprocessorService(AggregateService::newStub, (stub, controller, rpcCallback) -> stub.getRowNum(controller, req, rpcCallback), callback) .fromRow(nullToEmpty(scan.getStartRow()), scan.includeStartRow()) .toRow(nullToEmpty(scan.getStopRow()), scan.includeStopRow()).execute(); return future; }
public static <R, S, P extends Message, Q extends Message, T extends Message> CompletableFuture<Long> rowCount(AsyncTable<?> table, ColumnInterpreter<R, S, P, Q, T> ci, Scan scan) { CompletableFuture<Long> future = new CompletableFuture<>(); AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, true); } catch (IOException e) { future.completeExceptionally(e); return future; } AbstractAggregationCallback<Long> callback = new AbstractAggregationCallback<Long>(future) { private long count; @Override protected void aggregate(RegionInfo region, AggregateResponse resp) throws IOException { count += resp.getFirstPart(0).asReadOnlyByteBuffer().getLong(); } @Override protected Long getFinalResult() { return count; } }; table .<AggregateService, AggregateResponse> coprocessorService(AggregateService::newStub, (stub, controller, rpcCallback) -> stub.getRowNum(controller, req, rpcCallback), callback) .fromRow(nullToEmpty(scan.getStartRow()), scan.includeStartRow()) .toRow(nullToEmpty(scan.getStopRow()), scan.includeStopRow()).execute(); return future; }
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);
AggregateRequest req; try { req = validateArgAndGetPB(scan, ci, false); } catch (IOException e) { future.completeExceptionally(e);