org.apache.hadoop.hbase.thrift
Class ThriftUtilities

java.lang.Object
  extended by org.apache.hadoop.hbase.thrift.ThriftUtilities

public class ThriftUtilities
extends Object


Constructor Summary
ThriftUtilities()
           
 
Method Summary
static List<TCell> cellFromHBase(KeyValue in)
          This utility method creates a list of Thrift TCell "struct" based on an Hbase Cell object.
static List<TCell> cellFromHBase(KeyValue[] in)
          This utility method creates a list of Thrift TCell "struct" based on an Hbase Cell array.
static ColumnDescriptor colDescFromHbase(HColumnDescriptor in)
          This utility method creates a new Thrift ColumnDescriptor "struct" based on an Hbase HColumnDescriptor object.
static HColumnDescriptor colDescFromThrift(ColumnDescriptor in)
          This utility method creates a new Hbase HColumnDescriptor object based on a Thrift ColumnDescriptor "struct".
static Increment incrementFromThrift(TIncrement tincrement)
          From a TIncrement create an Increment.
static List<TRowResult> rowResultFromHBase(Result in)
           
static List<TRowResult> rowResultFromHBase(Result[] in)
          This utility method creates a list of Thrift TRowResult "struct" based on an array of Hbase RowResult objects.
static List<TRowResult> rowResultFromHBase(Result[] in, boolean sortColumns)
          This utility method creates a list of Thrift TRowResult "struct" based on an Hbase RowResult object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThriftUtilities

public ThriftUtilities()
Method Detail

colDescFromThrift

public static HColumnDescriptor colDescFromThrift(ColumnDescriptor in)
                                           throws IllegalArgument
This utility method creates a new Hbase HColumnDescriptor object based on a Thrift ColumnDescriptor "struct".

Parameters:
in - Thrift ColumnDescriptor object
Returns:
HColumnDescriptor
Throws:
IllegalArgument

colDescFromHbase

public static ColumnDescriptor colDescFromHbase(HColumnDescriptor in)
This utility method creates a new Thrift ColumnDescriptor "struct" based on an Hbase HColumnDescriptor object.

Parameters:
in - Hbase HColumnDescriptor object
Returns:
Thrift ColumnDescriptor

cellFromHBase

public static List<TCell> cellFromHBase(KeyValue in)
This utility method creates a list of Thrift TCell "struct" based on an Hbase Cell object. The empty list is returned if the input is null.

Parameters:
in - Hbase Cell object
Returns:
Thrift TCell array

cellFromHBase

public static List<TCell> cellFromHBase(KeyValue[] in)
This utility method creates a list of Thrift TCell "struct" based on an Hbase Cell array. The empty list is returned if the input is null.

Parameters:
in - Hbase Cell array
Returns:
Thrift TCell array

rowResultFromHBase

public static List<TRowResult> rowResultFromHBase(Result[] in,
                                                  boolean sortColumns)
This utility method creates a list of Thrift TRowResult "struct" based on an Hbase RowResult object. The empty list is returned if the input is null.

Parameters:
in - Hbase RowResult object
sortColumns - This boolean dictates if row data is returned in a sorted order sortColumns = True will set TRowResult's sortedColumns member which is an ArrayList of TColumn struct sortColumns = False will set TRowResult's columns member which is a map of columnName and TCell struct
Returns:
Thrift TRowResult array

rowResultFromHBase

public static List<TRowResult> rowResultFromHBase(Result[] in)
This utility method creates a list of Thrift TRowResult "struct" based on an array of Hbase RowResult objects. The empty list is returned if the input is null.

Parameters:
in - Array of Hbase RowResult objects
Returns:
Thrift TRowResult array

rowResultFromHBase

public static List<TRowResult> rowResultFromHBase(Result in)

incrementFromThrift

public static Increment incrementFromThrift(TIncrement tincrement)
From a TIncrement create an Increment.

Parameters:
tincrement - the Thrift version of an increment
Returns:
an increment that the TIncrement represented.


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