org.apache.hadoop.hbase.ipc
Interface TransactionalRegionInterface

All Superinterfaces:
HBaseRPCProtocolVersion, HRegionInterface, org.apache.hadoop.ipc.VersionedProtocol
All Known Subinterfaces:
IndexedRegionInterface
All Known Implementing Classes:
IndexedRegionServer, TransactionalRegionServer

public interface TransactionalRegionInterface
extends HRegionInterface

Interface for transactional region servers.

NOTE: if you change the interface, you must change the RPC version number in HBaseRPCProtocolVersion


Field Summary
 
Fields inherited from interface org.apache.hadoop.hbase.ipc.HBaseRPCProtocolVersion
versionID
 
Method Summary
 void abort(byte[] regionName, long transactionId)
          Abort the transaction.
 void batchUpdate(long transactionId, byte[] regionName, BatchUpdate b)
          Applies a batch of updates via one RPC
 void beginTransaction(long transactionId, byte[] regionName)
          Sent to initiate a transaction.
 void commit(byte[] regionName, long transactionId)
          Commit the transaction.
 boolean commitRequest(byte[] regionName, long transactionId)
          Ask if we can commit the given transaction.
 void deleteAll(long transactionId, byte[] regionName, byte[] row, long timestamp)
          Delete all cells that match the passed row and whose timestamp is equal-to or older than the passed timestamp.
 Cell get(long transactionId, byte[] regionName, byte[] row, byte[] column)
          Retrieve a single value from the specified region for the specified row and column keys
 Cell[] get(long transactionId, byte[] regionName, byte[] row, byte[] column, int numVersions)
          Get the specified number of versions of the specified row and column
 Cell[] get(long transactionId, byte[] regionName, 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(long transactionId, byte[] regionName, byte[] row, byte[][] columns)
          Get selected columns for the specified row at the latest timestamp.
 RowResult getRow(long transactionId, byte[] regionName, byte[] row, byte[][] columns, long ts)
          Get selected columns for the specified row at a given timestamp.
 RowResult getRow(long transactionId, byte[] regionName, byte[] row, long ts)
          Get all the data for the specified row at a given timestamp
 long openScanner(long transactionId, byte[] regionName, byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter)
          Opens a remote scanner with a RowFilter.
 
Methods inherited from interface org.apache.hadoop.hbase.ipc.HRegionInterface
batchUpdate, batchUpdates, checkAndSave, close, deleteAll, deleteAll, deleteAllByRegex, deleteFamily, deleteFamilyByRegex, exists, get, getClosestRowBefore, getRegionInfo, getRow, lockRow, next, next, openScanner, unlockRow
 
Methods inherited from interface org.apache.hadoop.ipc.VersionedProtocol
getProtocolVersion
 

Method Detail

beginTransaction

void beginTransaction(long transactionId,
                      byte[] regionName)
                      throws IOException
Sent to initiate a transaction.

Parameters:
transactionId -
regionName - name of region
Throws:
IOException

get

Cell get(long transactionId,
         byte[] regionName,
         byte[] row,
         byte[] column)
         throws IOException
Retrieve a single value from the specified region for the specified row and column keys

Parameters:
transactionId -
regionName - name of region
row - row key
column - column key
Returns:
alue for that region/row/column
Throws:
IOException

get

Cell[] get(long transactionId,
           byte[] regionName,
           byte[] row,
           byte[] column,
           int numVersions)
           throws IOException
Get the specified number of versions of the specified row and column

Parameters:
transactionId -
regionName - region name
row - row key
column - column key
numVersions - number of versions to return
Returns:
array of values
Throws:
IOException

get

Cell[] get(long transactionId,
           byte[] regionName,
           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:
transactionId -
regionName - region name
row - row key
column - column key
timestamp - timestamp
numVersions - number of versions to return
Returns:
array of values
Throws:
IOException

getRow

RowResult getRow(long transactionId,
                 byte[] regionName,
                 byte[] row,
                 long ts)
                 throws IOException
Get all the data for the specified row at a given timestamp

Parameters:
transactionId -
regionName - region name
row - row key
ts - timestamp
Returns:
map of values
Throws:
IOException

getRow

RowResult getRow(long transactionId,
                 byte[] regionName,
                 byte[] row,
                 byte[][] columns,
                 long ts)
                 throws IOException
Get selected columns for the specified row at a given timestamp.

Parameters:
transactionId -
regionName - region name
row - row key
columns - colums to get
ts - timestamp
Returns:
map of values
Throws:
IOException

getRow

RowResult getRow(long transactionId,
                 byte[] regionName,
                 byte[] row,
                 byte[][] columns)
                 throws IOException
Get selected columns for the specified row at the latest timestamp.

Parameters:
transactionId -
regionName - region name
row - row key
columns - columns to get
Returns:
map of values
Throws:
IOException

deleteAll

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

Parameters:
transactionId -
regionName - region name
row - row key
timestamp - Delete all entries that have this timestamp or older
Throws:
IOException

openScanner

long openScanner(long transactionId,
                 byte[] regionName,
                 byte[][] columns,
                 byte[] startRow,
                 long timestamp,
                 RowFilterInterface filter)
                 throws IOException
Opens a remote scanner with a RowFilter.

Parameters:
transactionId -
regionName - name of region to scan
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 for column family name. A column name is judged to be regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row to scan
timestamp - only return values whose timestamp is <= this value
filter - RowFilter for filtering results at the row-level.
Returns:
scannerId scanner identifier used in other calls
Throws:
IOException

batchUpdate

void batchUpdate(long transactionId,
                 byte[] regionName,
                 BatchUpdate b)
                 throws IOException
Applies a batch of updates via one RPC

Parameters:
transactionId -
regionName - name of the region to update
b - BatchUpdate
Throws:
IOException

commitRequest

boolean commitRequest(byte[] regionName,
                      long transactionId)
                      throws IOException
Ask if we can commit the given transaction.

Parameters:
regionName -
transactionId -
Returns:
true if we can commit
Throws:
IOException

commit

void commit(byte[] regionName,
            long transactionId)
            throws IOException
Commit the transaction.

Parameters:
regionName -
transactionId -
Throws:
IOException

abort

void abort(byte[] regionName,
           long transactionId)
           throws IOException
Abort the transaction.

Parameters:
regionName -
transactionId -
Throws:
IOException


Copyright © 2008 The Apache Software Foundation