org.apache.hadoop.hbase.thrift2.generated
Interface THBaseService.Iface

All Known Implementing Classes:
THBaseService.Client, ThriftHBaseServiceHandler
Enclosing class:
THBaseService

public static interface THBaseService.Iface


Method Summary
 boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle)
          Atomically checks if a row/family/qualifier value matches the expected value.
 boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put)
          Atomically checks if a row/family/qualifier value matches the expected value.
 void closeScanner(int scannerId)
          Closes the scanner.
 List<TDelete> deleteMultiple(ByteBuffer table, List<TDelete> deletes)
          Bulk commit a List of TDeletes to the table.
 void deleteSingle(ByteBuffer table, TDelete deleteSingle)
          Deletes as specified by the TDelete.
 boolean exists(ByteBuffer table, TGet get)
          Test for the existence of columns in the table, as specified in the TGet.
 TResult get(ByteBuffer table, TGet get)
          Method for getting data from a row.
 List<TResult> getMultiple(ByteBuffer table, List<TGet> gets)
          Method for getting multiple rows.
 List<TResult> getScannerResults(ByteBuffer table, TScan scan, int numRows)
          Get results for the provided TScan object.
 List<TResult> getScannerRows(int scannerId, int numRows)
          Grabs multiple rows from a Scanner.
 TResult increment(ByteBuffer table, TIncrement increment)
           
 void mutateRow(ByteBuffer table, TRowMutations rowMutations)
          mutateRow performs multiple mutations atomically on a single row.
 int openScanner(ByteBuffer table, TScan scan)
          Get a Scanner for the provided TScan object.
 void put(ByteBuffer table, TPut put)
          Commit a TPut to a table.
 void putMultiple(ByteBuffer table, List<TPut> puts)
          Commit a List of Puts to the table.
 

Method Detail

exists

boolean exists(ByteBuffer table,
               TGet get)
               throws TIOError,
                      org.apache.thrift.TException
Test for the existence of columns in the table, as specified in the TGet.

Parameters:
table - the table to check on
get - the TGet to check for
Returns:
true if the specified TGet matches one or more keys, false if not
Throws:
TIOError
org.apache.thrift.TException

get

TResult get(ByteBuffer table,
            TGet get)
            throws TIOError,
                   org.apache.thrift.TException
Method for getting data from a row. If the row cannot be found an empty Result is returned. This can be checked by the empty field of the TResult

Parameters:
table - the table to get from
get - the TGet to fetch
Returns:
the result
Throws:
TIOError
org.apache.thrift.TException

getMultiple

List<TResult> getMultiple(ByteBuffer table,
                          List<TGet> gets)
                          throws TIOError,
                                 org.apache.thrift.TException
Method for getting multiple rows. If a row cannot be found there will be a null value in the result list for that TGet at the same position. So the Results are in the same order as the TGets.

Parameters:
table - the table to get from
gets - a list of TGets to fetch, the Result list will have the Results at corresponding positions or null if there was an error
Throws:
TIOError
org.apache.thrift.TException

put

void put(ByteBuffer table,
         TPut put)
         throws TIOError,
                org.apache.thrift.TException
Commit a TPut to a table.

Parameters:
table - the table to put data in
put - the TPut to put
Throws:
TIOError
org.apache.thrift.TException

checkAndPut

boolean checkAndPut(ByteBuffer table,
                    ByteBuffer row,
                    ByteBuffer family,
                    ByteBuffer qualifier,
                    ByteBuffer value,
                    TPut put)
                    throws TIOError,
                           org.apache.thrift.TException
Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the TPut.

Parameters:
table - to check in and put to
row - row to check
family - column family to check
qualifier - column qualifier to check
value - the expected value, if not provided the check is for the non-existence of the column in question
put - the TPut to put if the check succeeds
Returns:
true if the new put was executed, false otherwise
Throws:
TIOError
org.apache.thrift.TException

putMultiple

void putMultiple(ByteBuffer table,
                 List<TPut> puts)
                 throws TIOError,
                        org.apache.thrift.TException
Commit a List of Puts to the table.

Parameters:
table - the table to put data in
puts - a list of TPuts to commit
Throws:
TIOError
org.apache.thrift.TException

deleteSingle

void deleteSingle(ByteBuffer table,
                  TDelete deleteSingle)
                  throws TIOError,
                         org.apache.thrift.TException
Deletes as specified by the TDelete. Note: "delete" is a reserved keyword and cannot be used in Thrift thus the inconsistent naming scheme from the other functions.

Parameters:
table - the table to delete from
deleteSingle - the TDelete to delete
Throws:
TIOError
org.apache.thrift.TException

deleteMultiple

List<TDelete> deleteMultiple(ByteBuffer table,
                             List<TDelete> deletes)
                             throws TIOError,
                                    org.apache.thrift.TException
Bulk commit a List of TDeletes to the table. Throws a TIOError if any of the deletes fail. Always returns an empty list for backwards compatibility.

Parameters:
table - the table to delete from
deletes - list of TDeletes to delete
Throws:
TIOError
org.apache.thrift.TException

checkAndDelete

boolean checkAndDelete(ByteBuffer table,
                       ByteBuffer row,
                       ByteBuffer family,
                       ByteBuffer qualifier,
                       ByteBuffer value,
                       TDelete deleteSingle)
                       throws TIOError,
                              org.apache.thrift.TException
Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the delete.

Parameters:
table - to check in and delete from
row - row to check
family - column family to check
qualifier - column qualifier to check
value - the expected value, if not provided the check is for the non-existence of the column in question
deleteSingle - the TDelete to execute if the check succeeds
Returns:
true if the new delete was executed, false otherwise
Throws:
TIOError
org.apache.thrift.TException

increment

TResult increment(ByteBuffer table,
                  TIncrement increment)
                  throws TIOError,
                         org.apache.thrift.TException
Throws:
TIOError
org.apache.thrift.TException

openScanner

int openScanner(ByteBuffer table,
                TScan scan)
                throws TIOError,
                       org.apache.thrift.TException
Get a Scanner for the provided TScan object.

Parameters:
table - the table to get the Scanner for
scan - the scan object to get a Scanner for
Returns:
Scanner Id to be used with other scanner procedures
Throws:
TIOError
org.apache.thrift.TException

getScannerRows

List<TResult> getScannerRows(int scannerId,
                             int numRows)
                             throws TIOError,
                                    TIllegalArgument,
                                    org.apache.thrift.TException
Grabs multiple rows from a Scanner.

Parameters:
scannerId - the Id of the Scanner to return rows from. This is an Id returned from the openScanner function.
numRows - number of rows to return
Returns:
Between zero and numRows TResults
Throws:
TIOError
TIllegalArgument
org.apache.thrift.TException

closeScanner

void closeScanner(int scannerId)
                  throws TIOError,
                         TIllegalArgument,
                         org.apache.thrift.TException
Closes the scanner. Should be called to free server side resources timely. Typically close once the scanner is not needed anymore, i.e. after looping over it to get all the required rows.

Parameters:
scannerId - the Id of the Scanner to close *
Throws:
TIOError
TIllegalArgument
org.apache.thrift.TException

mutateRow

void mutateRow(ByteBuffer table,
               TRowMutations rowMutations)
               throws TIOError,
                      org.apache.thrift.TException
mutateRow performs multiple mutations atomically on a single row.

Parameters:
table - table to apply the mutations
rowMutations - mutations to apply
Throws:
TIOError
org.apache.thrift.TException

getScannerResults

List<TResult> getScannerResults(ByteBuffer table,
                                TScan scan,
                                int numRows)
                                throws TIOError,
                                       org.apache.thrift.TException
Get results for the provided TScan object. This helper function opens a scanner, get the results and close the scanner.

Parameters:
table - the table to get the Scanner for
scan - the scan object to get a Scanner for
numRows - number of rows to return
Returns:
between zero and numRows TResults
Throws:
TIOError
org.apache.thrift.TException


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