org.apache.hadoop.hbase.types
Class RawBytesTerminated

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

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class RawBytesTerminated
extends TerminatedWrapper<byte[]>

An DataType that encodes variable-length values encoded using Bytes.putBytes(byte[], int, byte[], int, int). Includes a termination marker following the raw byte[] value. Intended to make it easier to transition away from direct use of Bytes.

See Also:
Bytes.putBytes(byte[], int, byte[], int, int), RawBytes, OrderedBlob

Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.types.TerminatedWrapper
term, wrapped
 
Constructor Summary
RawBytesTerminated(byte[] term)
          Create a RawBytesTerminated using the specified terminator.
RawBytesTerminated(Order order, byte[] term)
          Create a RawBytesTerminated using the specified terminator and order.
RawBytesTerminated(Order order, String term)
          Create a RawBytesTerminated using the specified terminator and order.
RawBytesTerminated(String term)
          Create a RawBytesTerminated using the specified terminator.
 
Method Summary
 byte[] decode(PositionedByteRange src, int length)
          Read a byte[] from the buffer src.
 int encode(PositionedByteRange dst, byte[] val, int voff, int vlen)
          Write val into dst, respecting offset and length.
 
Methods inherited from class org.apache.hadoop.hbase.types.TerminatedWrapper
decode, encode, encodedClass, encodedLength, getOrder, isNullable, isOrderPreserving, isSkippable, skip, terminatorPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawBytesTerminated

public RawBytesTerminated(Order order,
                          byte[] term)
Create a RawBytesTerminated using the specified terminator and order.

Throws:
IllegalArgumentException - if term is null or empty.

RawBytesTerminated

public RawBytesTerminated(Order order,
                          String term)
Create a RawBytesTerminated using the specified terminator and order.

Throws:
IllegalArgumentException - if term is null or empty.

RawBytesTerminated

public RawBytesTerminated(byte[] term)
Create a RawBytesTerminated using the specified terminator.

Throws:
IllegalArgumentException - if term is null or empty.

RawBytesTerminated

public RawBytesTerminated(String term)
Create a RawBytesTerminated using the specified terminator.

Throws:
IllegalArgumentException - if term is null or empty.
Method Detail

decode

public byte[] decode(PositionedByteRange src,
                     int length)
Read a byte[] from the buffer src.


encode

public int encode(PositionedByteRange dst,
                  byte[] val,
                  int voff,
                  int vlen)
Write val into dst, respecting offset and length.

Returns:
number of bytes written.


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