@InterfaceAudience.Private public class AggregateImplementation<T,S,P extends com.google.protobuf.Message,Q extends com.google.protobuf.Message,R extends com.google.protobuf.Message> extends org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService implements RegionCoprocessor
ColumnInterpreter
is used to interpret column value. This class is
parameterized with the following (these are the types with which the ColumnInterpreter
is parameterized, and for more description on these, refer to ColumnInterpreter
):org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService.BlockingInterface, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService.Interface, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService.Stub
Coprocessor.State
Modifier and Type | Field and Description |
---|---|
private RegionCoprocessorEnvironment |
env |
protected static org.slf4j.Logger |
log |
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
Constructor and Description |
---|
AggregateImplementation() |
Modifier and Type | Method and Description |
---|---|
(package private) ColumnInterpreter<T,S,P,Q,R> |
constructColumnInterpreterFromRequest(org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request) |
void |
getAvg(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives a Pair with first object as Sum and second object as row count,
computed for a given combination of column qualifier and column family in
the given row range as defined in the Scan object.
|
void |
getMax(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives the maximum for a given combination of column qualifier and column
family, in the given row range as defined in the Scan object.
|
void |
getMedian(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives a List containing sum of values and sum of weights.
|
void |
getMin(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives the minimum for a given combination of column qualifier and column
family, in the given row range as defined in the Scan object.
|
void |
getRowNum(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives the row count for the given column family and column qualifier, in
the given row range as defined in the Scan object.
|
Iterable<com.google.protobuf.Service> |
getServices()
Coprocessor endpoints providing protobuf services should override this method.
|
void |
getStd(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives a Pair with first object a List containing Sum and sum of squares,
and the second object as row count.
|
void |
getSum(com.google.protobuf.RpcController controller,
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
Gives the sum for a given combination of column qualifier and column
family, in the given row range as defined in the Scan object.
|
void |
start(CoprocessorEnvironment env)
Stores a reference to the coprocessor environment provided by the
RegionCoprocessorHost from the region where this
coprocessor is loaded. |
void |
stop(CoprocessorEnvironment env)
Called by the
CoprocessorEnvironment during it's own shutdown to stop the
coprocessor. |
callMethod, getDescriptor, getDescriptorForType, getRequestPrototype, getResponsePrototype, newBlockingStub, newReflectiveBlockingService, newReflectiveService, newStub
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBulkLoadObserver, getEndpointObserver, getRegionObserver
protected static final org.slf4j.Logger log
private RegionCoprocessorEnvironment env
public AggregateImplementation()
public void getMax(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
getMax
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
public void getMin(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
getMin
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
public void getSum(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
getSum
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
public void getRowNum(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
getRowNum
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
public void getAvg(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
The average is computed in AggregationClient#avg(byte[], ColumnInterpreter, Scan) by processing results from all regions, so its "ok" to pass sum and a Long type.
getAvg
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
public void getStd(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
getStd
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
public void getMedian(com.google.protobuf.RpcController controller, org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse> done)
getMedian
in class org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateService
ColumnInterpreter<T,S,P,Q,R> constructColumnInterpreterFromRequest(org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest request) throws IOException
IOException
public Iterable<com.google.protobuf.Service> getServices()
Coprocessor
getServices
in interface Coprocessor
Service
s or empty collection. Implementations should never
return null.public void start(CoprocessorEnvironment env) throws IOException
RegionCoprocessorHost
from the region where this
coprocessor is loaded. Since this is a coprocessor endpoint, it always expects to be loaded
on a table region, so always expects this to be an instance of
RegionCoprocessorEnvironment
.start
in interface Coprocessor
env
- the environment provided by the coprocessor hostIOException
- if the provided environment is not an instance of
RegionCoprocessorEnvironment
public void stop(CoprocessorEnvironment env) throws IOException
Coprocessor
CoprocessorEnvironment
during it's own shutdown to stop the
coprocessor.stop
in interface Coprocessor
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.