org.apache.hadoop.hbase.types
Class OrderedBlob

java.lang.Object
  extended by org.apache.hadoop.hbase.types.OrderedBytesBase<byte[]>
      extended by org.apache.hadoop.hbase.types.OrderedBlob
All Implemented Interfaces:
DataType<byte[]>

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class OrderedBlob
extends OrderedBytesBase<byte[]>

A byte[] of variable-length. Build on OrderedBytes.encodeBlobCopy(PositionedByteRange, byte[], int, int, Order).


Field Summary
static OrderedBlob ASCENDING
           
static OrderedBlob DESCENDING
           
 
Fields inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
order
 
Constructor Summary
protected OrderedBlob(Order order)
           
 
Method Summary
 byte[] decode(PositionedByteRange src)
          Read an instance of T from the buffer src.
 int encode(PositionedByteRange dst, byte[] val)
          Write instance val into buffer dst.
 int encode(PositionedByteRange dst, byte[] val, int voff, int vlen)
          Write a subset of val to dst.
 Class<byte[]> encodedClass()
          Inform consumers over what type this DataType operates.
 int encodedLength(byte[] val)
          Inform consumers how long the encoded byte[] will be.
 boolean isSkippable()
          Indicates whether this instance is able to skip over it's encoded value.
 
Methods inherited from class org.apache.hadoop.hbase.types.OrderedBytesBase
getOrder, isNullable, isOrderPreserving, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCENDING

public static final OrderedBlob ASCENDING

DESCENDING

public static final OrderedBlob DESCENDING
Constructor Detail

OrderedBlob

protected OrderedBlob(Order order)
Method Detail

isSkippable

public boolean isSkippable()
Description copied from interface: DataType
Indicates whether this instance is able to skip over it's encoded value. DataTypes that are not skippable can only be used as the right-most field of a Struct.

Specified by:
isSkippable in interface DataType<byte[]>
Overrides:
isSkippable in class OrderedBytesBase<byte[]>

encodedLength

public int encodedLength(byte[] val)
Description copied from interface: DataType
Inform consumers how long the encoded byte[] will be.

Parameters:
val - The value to check.
Returns:
the number of bytes required to encode val.a

encodedClass

public Class<byte[]> encodedClass()
Description copied from interface: DataType
Inform consumers over what type this DataType operates. Useful when working with bare DataType instances.


decode

public byte[] decode(PositionedByteRange src)
Description copied from interface: DataType
Read an instance of T from the buffer src.

Parameters:
src - the buffer containing the encoded value.

encode

public int encode(PositionedByteRange dst,
                  byte[] val)
Description copied from interface: DataType
Write instance val into buffer dst.

Parameters:
dst - the buffer containing the encoded value.
val - the value to encode onto dst.
Returns:
number of bytes written.

encode

public int encode(PositionedByteRange dst,
                  byte[] val,
                  int voff,
                  int vlen)
Write a subset of val to dst.



Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.