Class LongColumnInterpreter

java.lang.Object
org.apache.hadoop.hbase.coprocessor.ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
org.apache.hadoop.hbase.client.coprocessor.LongColumnInterpreter

@LimitedPrivate("Coprocesssor") @Evolving public class LongColumnInterpreter extends ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
a concrete column interpreter implementation. The cell value is a Long value and its promoted data type is also a Long value. For computing aggregation function, this class is used to find the datatype of the cell value. Client is supposed to instantiate it and passed along as a parameter. See TestAggregateProtocol methods for its sample usage. Its methods handle null arguments gracefully.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(Long l1, Long l2)
    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.
    int
    compare(Long l1, Long l2)
    This takes care if either of arguments are null.
    double
    used for computing average of <S> data values.
    getCellValueFromProto(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg q)
    This method gets the PB message corresponding to the cell type
    returns the maximum value for this type T
     
    getPromotedValueFromProto(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg r)
    This method gets the promoted type from the proto message
    org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg
    This method gets the PB message corresponding to the cell type
    org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg
    This method gets the PB message corresponding to the promoted type
    org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg
    This method should return any additional data that is needed on the server side to construct the ColumnInterpreter.
    getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
    Returns value of type T
    Returns increment
    void
    initialize(org.apache.hadoop.hbase.shaded.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(Long l1, Long l2)
    Returns multiplication

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getValue

      public Long getValue(byte[] colFamily, byte[] colQualifier, Cell kv) throws IOException
      Description copied from class: ColumnInterpreter
      Returns value of type T
      Specified by:
      getValue in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
      Throws:
      IOException
    • add

      public Long add(Long l1, Long l2)
      Description copied from class: ColumnInterpreter
      Returns sum or non null value among (if either of them is null); otherwise returns a null.
      Specified by:
      add in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • compare

      public int compare(Long l1, Long l2)
      Description copied from class: ColumnInterpreter
      This 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:
      compare in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • getMaxValue

      public Long getMaxValue()
      Description copied from class: ColumnInterpreter
      returns the maximum value for this type T
      Specified by:
      getMaxValue in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • increment

      public Long increment(Long o)
      Description copied from class: ColumnInterpreter
      Returns increment
      Specified by:
      increment in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • multiply

      public Long multiply(Long l1, Long l2)
      Description copied from class: ColumnInterpreter
      Returns multiplication
      Specified by:
      multiply in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • getMinValue

      public Long getMinValue()
      Specified by:
      getMinValue in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • divideForAvg

      public double divideForAvg(Long l1, Long l2)
      Description copied from class: ColumnInterpreter
      used 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:
      divideForAvg in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • castToReturnType

      Description copied from class: ColumnInterpreter
      provides casting opportunity between the data types.
      Specified by:
      castToReturnType in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • castToCellType

      public Long castToCellType(Long l)
      Description copied from class: ColumnInterpreter
      The response message comes as type S. This will convert/cast it to T. In some sense, performs the opposite of ColumnInterpreter.castToReturnType(Object)
      Specified by:
      castToCellType in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • getRequestData

      public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg getRequestData()
      Description copied from class: ColumnInterpreter
      This method should return any additional data that is needed on the server side to construct the ColumnInterpreter. The server will pass this to the ColumnInterpreter.initialize(P) method. If there is no ColumnInterpreter specific data (for e.g., LongColumnInterpreter) then null should be returned.
      Specified by:
      getRequestData in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
      Returns:
      the PB message
    • initialize

      public void initialize(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg msg)
      Description copied from class: ColumnInterpreter
      This method should initialize any field(s) of the ColumnInterpreter with a parsing of the passed message bytes (used on the server side).
      Specified by:
      initialize in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
    • getProtoForCellType

      public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg getProtoForCellType(Long t)
      Description copied from class: ColumnInterpreter
      This method gets the PB message corresponding to the cell type
      Specified by:
      getProtoForCellType in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
      Returns:
      the PB message for the cell-type instance
    • getProtoForPromotedType

      public org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg getProtoForPromotedType(Long s)
      Description copied from class: ColumnInterpreter
      This method gets the PB message corresponding to the promoted type
      Specified by:
      getProtoForPromotedType in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
      Returns:
      the PB message for the promoted-type instance
    • getPromotedValueFromProto

      public Long getPromotedValueFromProto(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg r)
      Description copied from class: ColumnInterpreter
      This method gets the promoted type from the proto message
      Specified by:
      getPromotedValueFromProto in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
      Returns:
      the promoted-type instance from the PB message
    • getCellValueFromProto

      public Long getCellValueFromProto(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg q)
      Description copied from class: ColumnInterpreter
      This method gets the PB message corresponding to the cell type
      Specified by:
      getCellValueFromProto in class ColumnInterpreter<Long,Long,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.EmptyMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg,org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.LongMsg>
      Returns:
      the cell-type instance from the PB message