org.apache.hadoop.hbase.client.transactional
Class TransactionalTable

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HTable
      extended by org.apache.hadoop.hbase.client.transactional.TransactionalTable
Direct Known Subclasses:
IndexedTable

public class TransactionalTable
extends HTable

Table with transactional support.


Nested Class Summary
protected  class TransactionalTable.TransactionalClientScanner
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.client.HTable
HTable.ClientScanner
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.client.HTable
scannerCaching, scannerTimeout
 
Constructor Summary
TransactionalTable(HBaseConfiguration conf, byte[] tableName)
           
TransactionalTable(HBaseConfiguration conf, String tableName)
           
 
Method Summary
 void commit(TransactionState transactionState, BatchUpdate batchUpdate)
          Commit a BatchUpdate to the table.
 void deleteAll(TransactionState transactionState, byte[] row, long ts)
          Delete all cells that match the passed row and whose timestamp is equal-to or older than the passed timestamp.
 Cell get(TransactionState transactionState, byte[] row, byte[] column)
          Get a single value for the specified row and column
 Cell[] get(TransactionState transactionState, byte[] row, byte[] column, int numVersions)
          Get the specified number of versions of the specified row and column
 Cell[] get(TransactionState transactionState, byte[] row, byte[] column, long timestamp, int numVersions)
          Get the specified number of versions of the specified row and column with the specified timestamp.
 RowResult getRow(TransactionState transactionState, byte[] row)
          Get all the data for the specified row at the latest timestamp
 RowResult getRow(TransactionState transactionState, byte[] row, byte[][] columns)
          Get selected columns for the specified row at the latest timestamp
 RowResult getRow(TransactionState transactionState, byte[] row, byte[][] columns, long ts)
          Get selected columns for the specified row at a specified timestamp
 RowResult getRow(TransactionState transactionState, byte[] row, long ts)
          Get all the data for the specified row at a specified timestamp
 Scanner getScanner(TransactionState transactionState, byte[][] columns)
          Get a scanner on the current table starting at first row.
 Scanner getScanner(TransactionState transactionState, byte[][] columns, byte[] startRow)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(TransactionState transactionState, byte[][] columns, byte[] startRow, long timestamp)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(TransactionState transactionState, byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(TransactionState transactionState, byte[][] columns, byte[] startRow, RowFilterInterface filter)
          Get a scanner on the current table starting at the specified row.
 
Methods inherited from class org.apache.hadoop.hbase.client.HTable
checkAndSave, close, commit, commit, commit, deleteAll, deleteAll, deleteAll, deleteAll, deleteAll, deleteAll, deleteAll, deleteAll, deleteAll, deleteAllByRegex, deleteAllByRegex, deleteAllByRegex, deleteAllByRegex, deleteFamily, deleteFamily, deleteFamily, deleteFamily, deleteFamily, deleteFamilyByRegex, deleteFamilyByRegex, deleteFamilyByRegex, deleteFamilyByRegex, deleteFamilyByRegex, exists, exists, exists, exists, flushCommits, get, get, get, get, get, get, getClosestRowBefore, getConnection, getRegionLocation, getRegionLocation, getRegionsInfo, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getRow, getScanner, getScanner, getScanner, getScanner, getScanner, getScanner, getScanner, getScanner, getScanner, getScanner, getScanner, getScannerCaching, getStartKeys, getTableDescriptor, getTableName, getWriteBuffer, getWriteBufferSize, isAutoFlush, isTableEnabled, isTableEnabled, isTableEnabled, isTableEnabled, lockRow, setAutoFlush, setScannerCaching, setWriteBufferSize, unlockRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalTable

public TransactionalTable(HBaseConfiguration conf,
                          String tableName)
                   throws IOException
Parameters:
conf -
tableName -
Throws:
IOException

TransactionalTable

public TransactionalTable(HBaseConfiguration conf,
                          byte[] tableName)
                   throws IOException
Parameters:
conf -
tableName -
Throws:
IOException
Method Detail

get

public Cell get(TransactionState transactionState,
                byte[] row,
                byte[] column)
         throws IOException
Get a single value for the specified row and column

Parameters:
transactionState -
row - row key
column - column name
Returns:
value for specified row/column
Throws:
IOException

get

public Cell[] get(TransactionState transactionState,
                  byte[] row,
                  byte[] column,
                  int numVersions)
           throws IOException
Get the specified number of versions of the specified row and column

Parameters:
transactionState -
row - - row key
column - - column name
numVersions - - number of versions to retrieve
Returns:
- array byte values
Throws:
IOException

get

public Cell[] get(TransactionState transactionState,
                  byte[] row,
                  byte[] column,
                  long timestamp,
                  int numVersions)
           throws IOException
Get the specified number of versions of the specified row and column with the specified timestamp.

Parameters:
transactionState -
row - - row key
column - - column name
timestamp - - timestamp
numVersions - - number of versions to retrieve
Returns:
- array of values that match the above criteria
Throws:
IOException

getRow

public RowResult getRow(TransactionState transactionState,
                        byte[] row)
                 throws IOException
Get all the data for the specified row at the latest timestamp

Parameters:
transactionState -
row - row key
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(TransactionState transactionState,
                        byte[] row,
                        long ts)
                 throws IOException
Get all the data for the specified row at a specified timestamp

Parameters:
transactionState -
row - row key
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(TransactionState transactionState,
                        byte[] row,
                        byte[][] columns)
                 throws IOException
Get selected columns for the specified row at the latest timestamp

Parameters:
transactionState -
row - row key
columns - Array of column names you want to retrieve.
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(TransactionState transactionState,
                        byte[] row,
                        byte[][] columns,
                        long ts)
                 throws IOException
Get selected columns for the specified row at a specified timestamp

Parameters:
transactionState -
row - row key
columns - Array of column names you want to retrieve.
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

deleteAll

public void deleteAll(TransactionState transactionState,
                      byte[] row,
                      long ts)
               throws IOException
Delete all cells that match the passed row and whose timestamp is equal-to or older than the passed timestamp.

Parameters:
transactionState -
row - Row to update
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

getScanner

public Scanner getScanner(TransactionState transactionState,
                          byte[][] columns)
                   throws IOException
Get a scanner on the current table starting at first row. Return the specified columns.

Parameters:
transactionState -
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(TransactionState transactionState,
                          byte[][] columns,
                          byte[] startRow)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
transactionState -
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(TransactionState transactionState,
                          byte[][] columns,
                          byte[] startRow,
                          long timestamp)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
transactionState -
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
timestamp - only return results whose timestamp <= this value
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(TransactionState transactionState,
                          byte[][] columns,
                          byte[] startRow,
                          RowFilterInterface filter)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
transactionState -
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
filter - a row filter using row-key regexp and/or column data filter.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(TransactionState transactionState,
                          byte[][] columns,
                          byte[] startRow,
                          long timestamp,
                          RowFilterInterface filter)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
transactionState -
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
timestamp - only return results whose timestamp <= this value
filter - a row filter using row-key regexp and/or column data filter.
Returns:
scanner
Throws:
IOException

commit

public void commit(TransactionState transactionState,
                   BatchUpdate batchUpdate)
            throws IOException
Commit a BatchUpdate to the table.

Parameters:
transactionState -
batchUpdate -
Throws:
IOException


Copyright © 2008 The Apache Software Foundation