@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 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
):AggregateProtos.AggregateService.BlockingInterface, AggregateProtos.AggregateService.Interface, AggregateProtos.AggregateService.Stub
Coprocessor.State
Modifier and Type | Field and Description |
---|---|
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 |
---|---|
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.
|
Iterable<com.google.protobuf.Service> |
getServices()
Coprocessor endpoints providing protobuf services should override this method.
|
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)
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
public void getMax(com.google.protobuf.RpcController controller, AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getMax
in class AggregateProtos.AggregateService
public void getMin(com.google.protobuf.RpcController controller, AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getMin
in class AggregateProtos.AggregateService
public void getSum(com.google.protobuf.RpcController controller, AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getSum
in class AggregateProtos.AggregateService
public void getRowNum(com.google.protobuf.RpcController controller, AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getRowNum
in class AggregateProtos.AggregateService
public 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.AggregateService
public void getStd(com.google.protobuf.RpcController controller, AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getStd
in class AggregateProtos.AggregateService
public void getMedian(com.google.protobuf.RpcController controller, AggregateProtos.AggregateRequest request, com.google.protobuf.RpcCallback<AggregateProtos.AggregateResponse> done)
getMedian
in class AggregateProtos.AggregateService
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 Cloudera. All rights reserved.