T - Cell value data typeS - Promoted data typeP - PB message that is used to transport initializer specific bytesQ - PB message that is used to transport Cell (R - PB message that is used to transport Promoted (@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 AggregateProtos.AggregateService implements CoprocessorService, Coprocessor
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):AggregateProtos.AggregateService.BlockingInterface, AggregateProtos.AggregateService.Interface, AggregateProtos.AggregateService.StubCoprocessor.State| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION| Constructor and Description |
|---|
AggregateImplementation() |
| Modifier and Type | Method and Description |
|---|---|
void |
getAvg(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
Gives a List containing sum of values and sum of weights.
|
void |
getMin(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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.
|
com.google.protobuf.Service |
getService() |
void |
getStd(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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) |
callMethod, getDescriptor, getDescriptorForType, getRequestPrototype, getResponsePrototype, newBlockingStub, newReflectiveBlockingService, newReflectiveService, newStubpublic void getMax(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getMax in class AggregateProtos.AggregateServicepublic void getMin(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getMin in class AggregateProtos.AggregateServicepublic void getSum(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getSum in class AggregateProtos.AggregateServicepublic void getRowNum(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getRowNum in class AggregateProtos.AggregateServiceIOExceptionpublic void getAvg(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<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 AggregateProtos.AggregateServicepublic void getStd(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getStd in class AggregateProtos.AggregateServicepublic void getMedian(com.google.protobuf.RpcController controller,
AggregateProtos.AggregateRequest request,
com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getMedian in class AggregateProtos.AggregateServicepublic com.google.protobuf.Service getService()
getService in interface CoprocessorServicepublic 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 Coprocessorenv - the environment provided by the coprocessor hostIOException - if the provided environment is not an instance of
RegionCoprocessorEnvironmentpublic void stop(CoprocessorEnvironment env) throws IOException
stop in interface CoprocessorIOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.