private abstract static class AsyncAggregationClient.AbstractAggregationCallback<T> extends Object implements AsyncTable.CoprocessorCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse>
Modifier and Type | Field and Description |
---|---|
protected boolean |
finished |
private CompletableFuture<T> |
future |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAggregationCallback(CompletableFuture<T> future) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
aggregate(RegionInfo region,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse resp) |
private void |
completeExceptionally(Throwable error) |
protected abstract T |
getFinalResult() |
void |
onComplete()
Indicate that all responses of the regions have been notified by calling
AsyncTable.CoprocessorCallback.onRegionComplete(RegionInfo, Object) or
AsyncTable.CoprocessorCallback.onRegionError(RegionInfo, Throwable) . |
void |
onError(Throwable error)
Indicate that we got an error which does not belong to any regions.
|
void |
onRegionComplete(RegionInfo region,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse resp) |
void |
onRegionError(RegionInfo region,
Throwable error) |
private final CompletableFuture<T> future
protected boolean finished
protected AbstractAggregationCallback(CompletableFuture<T> future)
private void completeExceptionally(Throwable error)
public void onRegionError(RegionInfo region, Throwable error)
onRegionError
in interface AsyncTable.CoprocessorCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse>
region
- the region that the error belongs toerror
- the response error of the coprocessor callpublic void onError(Throwable error)
AsyncTable.CoprocessorCallback
onError
in interface AsyncTable.CoprocessorCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse>
protected abstract void aggregate(RegionInfo region, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse resp) throws IOException
IOException
public void onRegionComplete(RegionInfo region, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse resp)
onRegionComplete
in interface AsyncTable.CoprocessorCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse>
region
- the region that the response belongs toresp
- the response of the coprocessor callprotected abstract T getFinalResult()
public void onComplete()
AsyncTable.CoprocessorCallback
AsyncTable.CoprocessorCallback.onRegionComplete(RegionInfo, Object)
or
AsyncTable.CoprocessorCallback.onRegionError(RegionInfo, Throwable)
.onComplete
in interface AsyncTable.CoprocessorCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse>
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.