org.apache.hadoop.hbase
Class CellUtil

java.lang.Object
  extended by org.apache.hadoop.hbase.CellUtil

@InterfaceAudience.Private
@InterfaceStability.Evolving
public final class CellUtil
extends Object

Utility methods helpful slinging Cell instances.


Constructor Summary
CellUtil()
           
 
Method Summary
static int copyFamilyTo(Cell cell, byte[] destination, int destinationOffset)
           
static int copyQualifierTo(Cell cell, byte[] destination, int destinationOffset)
           
static int copyRowTo(Cell cell, byte[] destination, int destinationOffset)
          copyTo
static int copyValueTo(Cell cell, byte[] destination, int destinationOffset)
           
static Cell createCell(byte[] row, byte[] family, byte[] qualifier, long timestamp, byte type, byte[] value)
           
static CellScanner createCellScanner(Cell[] cellArray)
           
static CellScanner createCellScanner(Iterable<Cell> cellIterable)
           
static CellScanner createCellScanner(Iterator<Cell> cells)
           
static CellScanner createCellScanner(List<CellScannable> cellScannerables)
           
static CellScanner createCellScanner(NavigableMap<byte[],List<Cell>> map)
          Flatten the map of cells out under the CellScanner
static int estimatedSizeOf(Cell cell)
           
static ByteRange fillFamilyRange(Cell cell, ByteRange range)
           
static ByteRange fillQualifierRange(Cell cell, ByteRange range)
           
static ByteRange fillRowRange(Cell cell, ByteRange range)
          ByteRange
static byte[] getFamilyArray(Cell cell)
           
static byte[] getQualifierArray(Cell cell)
           
static byte[] getRowArray(Cell cell)
          get individual arrays for tests
static byte getRowByte(Cell cell, int index)
          misc
static byte[] getValueArray(Cell cell)
           
static ByteBuffer getValueBufferShallowCopy(Cell cell)
           
static boolean isDelete(Cell cell)
           
static boolean matchingRow(Cell left, Cell right)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellUtil

public CellUtil()
Method Detail

fillRowRange

public static ByteRange fillRowRange(Cell cell,
                                     ByteRange range)
ByteRange


fillFamilyRange

public static ByteRange fillFamilyRange(Cell cell,
                                        ByteRange range)

fillQualifierRange

public static ByteRange fillQualifierRange(Cell cell,
                                           ByteRange range)

getRowArray

public static byte[] getRowArray(Cell cell)
get individual arrays for tests


getFamilyArray

public static byte[] getFamilyArray(Cell cell)

getQualifierArray

public static byte[] getQualifierArray(Cell cell)

getValueArray

public static byte[] getValueArray(Cell cell)

copyRowTo

public static int copyRowTo(Cell cell,
                            byte[] destination,
                            int destinationOffset)
copyTo


copyFamilyTo

public static int copyFamilyTo(Cell cell,
                               byte[] destination,
                               int destinationOffset)

copyQualifierTo

public static int copyQualifierTo(Cell cell,
                                  byte[] destination,
                                  int destinationOffset)

copyValueTo

public static int copyValueTo(Cell cell,
                              byte[] destination,
                              int destinationOffset)

getRowByte

public static byte getRowByte(Cell cell,
                              int index)
misc


getValueBufferShallowCopy

public static ByteBuffer getValueBufferShallowCopy(Cell cell)

createCell

public static Cell createCell(byte[] row,
                              byte[] family,
                              byte[] qualifier,
                              long timestamp,
                              byte type,
                              byte[] value)

createCellScanner

public static CellScanner createCellScanner(List<CellScannable> cellScannerables)
Parameters:
cellScannerables -
Returns:
CellScanner interface over cellIterables

createCellScanner

public static CellScanner createCellScanner(Iterable<Cell> cellIterable)
Parameters:
cellIterable -
Returns:
CellScanner interface over cellIterable

createCellScanner

public static CellScanner createCellScanner(Iterator<Cell> cells)
Parameters:
cells -
Returns:
CellScanner interface over cellIterable

createCellScanner

public static CellScanner createCellScanner(Cell[] cellArray)
Parameters:
cellArray -
Returns:
CellScanner interface over cellArray

createCellScanner

public static CellScanner createCellScanner(NavigableMap<byte[],List<Cell>> map)
Flatten the map of cells out under the CellScanner

Parameters:
map - Map of Cell Lists; for example, the map of families to Cells that is used inside Put, etc., keeping Cells organized by family.
Returns:
CellScanner interface over cellIterable

matchingRow

public static boolean matchingRow(Cell left,
                                  Cell right)
Parameters:
left -
right -
Returns:
True if the rows in left and right Cells match

isDelete

public static boolean isDelete(Cell cell)
Returns:
True if a delete type, a KeyValue.Type.Delete or a {KeyValue.Type#DeleteFamily} or a KeyValue.Type.DeleteColumn KeyValue type.

estimatedSizeOf

public static int estimatedSizeOf(Cell cell)
Parameters:
cell -
Returns:
Estimate of the cell size in bytes.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.