org.apache.hadoop.hbase.thrift2
Class ThriftUtilities

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

public class ThriftUtilities
extends Object


Method Summary
static TDelete deleteFromHBase(Delete in)
           
static Delete deleteFromThrift(TDelete in)
          Creates a Delete (HBase) from a TDelete (Thrift).
static List<TDelete> deletesFromHBase(List<Delete> in)
           
static List<Delete> deletesFromThrift(List<TDelete> in)
          Converts multiple TDeletes (Thrift) into a list of Deletes (HBase).
static Get getFromThrift(TGet in)
          Creates a Get (HBase) from a TGet (Thrift).
static List<Get> getsFromThrift(List<TGet> in)
          Converts multiple TGets (Thrift) into a list of Gets (HBase).
static Increment incrementFromThrift(TIncrement in)
           
static Put putFromThrift(TPut in)
          Creates a Put (HBase) from a TPut (Thrift)
static List<Put> putsFromThrift(List<TPut> in)
          Converts multiple TPuts (Thrift) into a list of Puts (HBase).
static TResult resultFromHBase(Result in)
          Creates a TResult (Thrift) from a Result (HBase).
static List<TResult> resultsFromHBase(Result[] in)
          Converts multiple Results (HBase) into a list of TResults (Thrift).
static Scan scanFromThrift(TScan in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFromThrift

public static Get getFromThrift(TGet in)
                         throws IOException
Creates a Get (HBase) from a TGet (Thrift). This ignores any timestamps set on TColumn objects.

Parameters:
in - the TGet to convert
Returns:
Get object
Throws:
IOException - if an invalid time range or max version parameter is given

getsFromThrift

public static List<Get> getsFromThrift(List<TGet> in)
                                throws IOException
Converts multiple TGets (Thrift) into a list of Gets (HBase).

Parameters:
in - list of TGets to convert
Returns:
list of Get objects
Throws:
IOException - if an invalid time range or max version parameter is given
See Also:
getFromThrift(TGet)

resultFromHBase

public static TResult resultFromHBase(Result in)
Creates a TResult (Thrift) from a Result (HBase).

Parameters:
in - the Result to convert
Returns:
converted result, returns an empty result if the input is null

resultsFromHBase

public static List<TResult> resultsFromHBase(Result[] in)
Converts multiple Results (HBase) into a list of TResults (Thrift).

Parameters:
in - array of Results to convert
Returns:
list of converted TResults
See Also:
resultFromHBase(Result)

putFromThrift

public static Put putFromThrift(TPut in)
Creates a Put (HBase) from a TPut (Thrift)

Parameters:
in - the TPut to convert
Returns:
converted Put

putsFromThrift

public static List<Put> putsFromThrift(List<TPut> in)
Converts multiple TPuts (Thrift) into a list of Puts (HBase).

Parameters:
in - list of TPuts to convert
Returns:
list of converted Puts
See Also:
putFromThrift(TPut)

deleteFromThrift

public static Delete deleteFromThrift(TDelete in)
Creates a Delete (HBase) from a TDelete (Thrift).

Parameters:
in - the TDelete to convert
Returns:
converted Delete

deletesFromThrift

public static List<Delete> deletesFromThrift(List<TDelete> in)
Converts multiple TDeletes (Thrift) into a list of Deletes (HBase).

Parameters:
in - list of TDeletes to convert
Returns:
list of converted Deletes
See Also:
deleteFromThrift(TDelete)

deleteFromHBase

public static TDelete deleteFromHBase(Delete in)

deletesFromHBase

public static List<TDelete> deletesFromHBase(List<Delete> in)

scanFromThrift

public static Scan scanFromThrift(TScan in)
                           throws IOException
Throws:
IOException

incrementFromThrift

public static Increment incrementFromThrift(TIncrement in)
                                     throws IOException
Throws:
IOException


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