public class AggregateImplementation extends BaseEndpointCoprocessor implements AggregateProtocol
Coprocessor.State
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
VERSION
VERSION
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER
Constructor and Description |
---|
AggregateImplementation() |
Modifier and Type | Method and Description |
---|---|
<T,S> Pair<S,Long> |
getAvg(ColumnInterpreter<T,S> ci,
Scan scan)
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.
|
<T,S> T |
getMax(ColumnInterpreter<T,S> ci,
Scan scan)
Gives the maximum for a given combination of column qualifier and column
family, in the given row range as defined in the Scan object.
|
<T,S> List<S> |
getMedian(ColumnInterpreter<T,S> ci,
Scan scan)
Gives a List containing sum of values and sum of weights.
|
<T,S> T |
getMin(ColumnInterpreter<T,S> ci,
Scan scan)
Gives the minimum for a given combination of column qualifier and column
family, in the given row range as defined in the Scan object.
|
ProtocolSignature |
getProtocolSignature(String protocol,
long version,
int clientMethodsHashCode)
Return protocol version corresponding to protocol interface.
|
<T,S> long |
getRowNum(ColumnInterpreter<T,S> ci,
Scan scan) |
<T,S> Pair<List<S>,Long> |
getStd(ColumnInterpreter<T,S> ci,
Scan scan)
Gives a Pair with first object a List containing Sum and sum of squares,
and the second object as row count.
|
<T,S> S |
getSum(ColumnInterpreter<T,S> ci,
Scan scan)
Gives the sum for a given combination of column qualifier and column
family, in the given row range as defined in the Scan object.
|
getEnvironment, getProtocolVersion, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProtocolVersion
public ProtocolSignature getProtocolSignature(String protocol, long version, int clientMethodsHashCode) throws IOException
VersionedProtocol
getProtocolSignature
in interface VersionedProtocol
getProtocolSignature
in class BaseEndpointCoprocessor
protocol
- The classname of the protocol interfaceversion
- The version of the protocol that the client speaksclientMethodsHashCode
- the hashcode of client protocol methodsIOException
for a default implementation
public <T,S> T getMax(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
AggregateProtocol
getMax
in interface AggregateProtocol
IOException
public <T,S> T getMin(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
AggregateProtocol
getMin
in interface AggregateProtocol
IOException
public <T,S> S getSum(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
AggregateProtocol
getSum
in interface AggregateProtocol
IOException
public <T,S> long getRowNum(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
getRowNum
in interface AggregateProtocol
IOException
public <T,S> Pair<S,Long> getAvg(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
AggregateProtocol
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 interface AggregateProtocol
IOException
public <T,S> Pair<List<S>,Long> getStd(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
AggregateProtocol
getStd
in interface AggregateProtocol
IOException
public <T,S> List<S> getMedian(ColumnInterpreter<T,S> ci, Scan scan) throws IOException
AggregateProtocol
getMedian
in interface AggregateProtocol
IOException
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.