Class BigDecimalColumnInterpreter
java.lang.Object
org.apache.hadoop.hbase.coprocessor.ColumnInterpreter<BigDecimal,BigDecimal,org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg,org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
org.apache.hadoop.hbase.client.coprocessor.BigDecimalColumnInterpreter
@LimitedPrivate("Coprocesssor")
@Evolving
public class BigDecimalColumnInterpreter
extends ColumnInterpreter<BigDecimal,BigDecimal,org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg,org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
ColumnInterpreter for doing Aggregation's with BigDecimal columns. This class is required at the
RegionServer also.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(BigDecimal bd1, BigDecimal bd2) Returns sum or non null value among (if either of them is null); otherwise returns a null.The response message comes as type S.provides casting opportunity between the data types.intcompare(BigDecimal bd1, BigDecimal bd2) This takes care if either of arguments are null.doubledivideForAvg(BigDecimal bd1, Long l2) used for computing average of <S> data values.getCellValueFromProto(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg q) This method gets the PB message corresponding to the cell typereturns the maximum value for this type TgetPromotedValueFromProto(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg r) This method gets the promoted type from the proto messageorg.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsgThis method gets the PB message corresponding to the cell typeorg.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsgThis method gets the PB message corresponding to the promoted typeprivate org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsgorg.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsgThis method should return any additional data that is needed on the server side to construct the ColumnInterpreter.Returns value of type Tincrement(BigDecimal bd) Returns incrementvoidinitialize(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg msg) This method should initialize any field(s) of the ColumnInterpreter with a parsing of the passed message bytes (used on the server side).multiply(BigDecimal bd1, BigDecimal bd2) Returns multiplication
-
Constructor Details
-
BigDecimalColumnInterpreter
public BigDecimalColumnInterpreter()
-
-
Method Details
-
getValue
Description copied from class:ColumnInterpreterReturns value of type T- Specified by:
getValuein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg> - Throws:
IOException
-
add
Description copied from class:ColumnInterpreterReturns sum or non null value among (if either of them is null); otherwise returns a null.- Specified by:
addin classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
compare
Description copied from class:ColumnInterpreterThis takes care if either of arguments are null. returns 0 if they are equal or both are null;- > 0 if l1 > l2 or l1 is not null and l2 is null.
- < 0 if l1 < l2 or l1 is null and l2 is not null.
- Specified by:
comparein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
getMaxValue
Description copied from class:ColumnInterpreterreturns the maximum value for this type T- Specified by:
getMaxValuein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
increment
Description copied from class:ColumnInterpreterReturns increment- Specified by:
incrementin classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
multiply
Description copied from class:ColumnInterpreterReturns multiplication- Specified by:
multiplyin classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
getMinValue
- Specified by:
getMinValuein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
divideForAvg
Description copied from class:ColumnInterpreterused for computing average of <S> data values. Not providing the divide method that takes two <S> values as it is not needed as of now.- Specified by:
divideForAvgin classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
castToReturnType
Description copied from class:ColumnInterpreterprovides casting opportunity between the data types.- Specified by:
castToReturnTypein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
castToCellType
Description copied from class:ColumnInterpreterThe response message comes as type S. This will convert/cast it to T. In some sense, performs the opposite ofColumnInterpreter.castToReturnType(Object)- Specified by:
castToCellTypein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
getRequestData
Description copied from class:ColumnInterpreterThis method should return any additional data that is needed on the server side to construct the ColumnInterpreter. The server will pass this to theColumnInterpreter.initialize(P)method. If there is no ColumnInterpreter specific data (for e.g.,LongColumnInterpreter) then null should be returned.- Specified by:
getRequestDatain classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg> - Returns:
- the PB message
-
initialize
Description copied from class:ColumnInterpreterThis method should initialize any field(s) of the ColumnInterpreter with a parsing of the passed message bytes (used on the server side).- Specified by:
initializein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg>
-
getProtoForType
private org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg getProtoForType(BigDecimal t) -
getProtoForCellType
public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg getProtoForCellType(BigDecimal t) Description copied from class:ColumnInterpreterThis method gets the PB message corresponding to the cell type- Specified by:
getProtoForCellTypein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg> - Returns:
- the PB message for the cell-type instance
-
getProtoForPromotedType
public org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg getProtoForPromotedType(BigDecimal s) Description copied from class:ColumnInterpreterThis method gets the PB message corresponding to the promoted type- Specified by:
getProtoForPromotedTypein classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg> - Returns:
- the PB message for the promoted-type instance
-
getPromotedValueFromProto
public BigDecimal getPromotedValueFromProto(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg r) Description copied from class:ColumnInterpreterThis method gets the promoted type from the proto message- Specified by:
getPromotedValueFromProtoin classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg> - Returns:
- the promoted-type instance from the PB message
-
getCellValueFromProto
public BigDecimal getCellValueFromProto(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg q) Description copied from class:ColumnInterpreterThis method gets the PB message corresponding to the cell type- Specified by:
getCellValueFromProtoin classColumnInterpreter<BigDecimal,BigDecimal, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.EmptyMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BigDecimalMsg> - Returns:
- the cell-type instance from the PB message
-