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 abstract class ColumnInterpreter<T,S,P extends Message,Q extends Message,R extends Message> extends Object
LongColumnInterpreter
for an
example.
Takes two generic parameters and three Message parameters.
The cell value type of the interpreter is . All computations are performed on the promoted data type
. There is a conversion method
castToReturnType(Object)
which takes a type.
The AggregateImplementation uses PB messages to initialize the
user's ColumnInterpreter implementation, and for sending the responses
back to AggregationClient.
Constructor and Description |
---|
ColumnInterpreter() |
Modifier and Type | Method and Description |
---|---|
abstract S |
add(S l1,
S l2) |
abstract T |
castToCellType(S response)
The response message comes as type S.
|
abstract S |
castToReturnType(T o)
provides casting opportunity between the data types.
|
abstract int |
compare(T l1,
T l2)
This takes care if either of arguments are null.
|
abstract double |
divideForAvg(S o,
Long l)
used for computing average of
|
abstract T |
getCellValueFromProto(Q q)
This method gets the PB message corresponding to the cell type
|
abstract T |
getMaxValue()
returns the maximum value for this type T
|
abstract T |
getMinValue() |
abstract S |
getPromotedValueFromProto(R r)
This method gets the promoted type from the proto message
|
abstract Q |
getProtoForCellType(T t)
This method gets the PB message corresponding to the cell type
|
abstract R |
getProtoForPromotedType(S s)
This method gets the PB message corresponding to the promoted type
|
abstract P |
getRequestData()
This method should return any additional data that is needed on the
server side to construct the ColumnInterpreter.
|
T |
getValue(byte[] colFamily,
byte[] colQualifier,
Cell c)
TODO: when removing
getValue(byte[], byte[], KeyValue) , this method should be made abstract |
T |
getValue(byte[] colFamily,
byte[] colQualifier,
KeyValue kv)
Deprecated.
|
abstract S |
increment(S o) |
abstract void |
initialize(P msg)
This method should initialize any field(s) of the ColumnInterpreter with
a parsing of the passed message bytes (used on the server side).
|
abstract S |
multiply(S o1,
S o2) |
public T getValue(byte[] colFamily, byte[] colQualifier, Cell c) throws IOException
getValue(byte[], byte[], KeyValue)
, this method should be made abstractcolFamily
- colQualifier
- c
- IOException
@Deprecated public T getValue(byte[] colFamily, byte[] colQualifier, KeyValue kv) throws IOException
getValue(byte[], byte[], Cell)
instead.IOException
public abstract S add(S l1, S l2)
l1
- l2
- public abstract T getMaxValue()
public abstract T getMinValue()
public abstract S castToReturnType(T o)
o
- public abstract int compare(T l1, T l2)
public abstract double divideForAvg(S o, Long l)
o
- l
- public abstract P getRequestData()
initialize(P)
method. If there is no ColumnInterpreter specific data (for e.g.,
LongColumnInterpreter
) then null should be returned.public abstract void initialize(P msg)
msg
- public abstract Q getProtoForCellType(T t)
t
- public abstract T getCellValueFromProto(Q q)
q
- public abstract R getProtoForPromotedType(S s)
s
- public abstract S getPromotedValueFromProto(R r)
r
- public abstract T castToCellType(S response)
castToReturnType(Object)
response
- Copyright © 2014 The Apache Software Foundation. All Rights Reserved.