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
static int COMMIT_OK
          Status code representing a transaction that can be committed.
static int COMMIT_OK_READ_ONLY
          Status code representing a read-only transaction that can be committed.
static int COMMIT_UNSUCESSFUL
          Status code representing a transaction that cannot be committed.
 
Fields inherited from interface org.apache.hadoop.hbase.ipc.HBaseRPCProtocolVersion
versionID
 
Method Summary
 void abort(byte[] regionName, long transactionId)
          Abort the transaction.
 void beginTransaction(long transactionId, byte[] regionName)
          Sent to initiate a transaction.
 void commit(byte[] regionName, long transactionId)
          Commit the transaction.
 boolean commitIfPossible(byte[] regionName, long transactionId)
          Try to commit the given transaction.
 int commitRequest(byte[] regionName, long transactionId)
          Ask if we can commit the given transaction.
 void delete(long transactionId, byte[] regionName, Delete delete)
          Deletes all the KeyValues that match those found in the Delete object, if their ts <= to the Delete.
 Result get(long transactionId, byte[] regionName, Get get)
          Perform a transactional Get operation.
 long openScanner(long transactionId, byte[] regionName, Scan scan)
          Opens a remote transactional scanner with a RowFilter.
 void put(long transactionId, byte[] regionName, Put put)
          Transactional put data into the specified region
 int put(long transactionId, byte[] regionName, Put[] puts)
          Put an array of puts into the specified region
 
Methods inherited from interface org.apache.hadoop.hbase.ipc.HRegionInterface
checkAndPut, close, delete, delete, exists, get, getClosestRowBefore, getHServerInfo, getOnlineRegionsAsArray, getRegionInfo, getRegionsAssignment, incrementColumnValue, lockRow, next, next, openScanner, put, put, unlockRow
 
Methods inherited from interface org.apache.hadoop.ipc.VersionedProtocol
getProtocolVersion
 

Field Detail

COMMIT_OK

static final int COMMIT_OK
Status code representing a transaction that can be committed.

See Also:
Constant Field Values

COMMIT_OK_READ_ONLY

static final int COMMIT_OK_READ_ONLY
Status code representing a read-only transaction that can be committed.

See Also:
Constant Field Values

COMMIT_UNSUCESSFUL

static final int COMMIT_UNSUCESSFUL
Status code representing a transaction that cannot be committed.

See Also:
Constant Field Values
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

Result get(long transactionId,
           byte[] regionName,
           Get get)
           throws IOException
Perform a transactional Get operation.

Parameters:
regionName - name of region to get from
get - Get operation
Returns:
Result
Throws:
IOException

put

void put(long transactionId,
         byte[] regionName,
         Put put)
         throws IOException
Transactional put data into the specified region

Parameters:
regionName -
put - the data to be put
Throws:
IOException

put

int put(long transactionId,
        byte[] regionName,
        Put[] puts)
        throws IOException
Put an array of puts into the specified region

Parameters:
regionName -
puts -
Returns:
result
Throws:
IOException

delete

void delete(long transactionId,
            byte[] regionName,
            Delete delete)
            throws IOException
Deletes all the KeyValues that match those found in the Delete object, if their ts <= to the Delete. In case of a delete with a specific ts it only deletes that specific KeyValue.

Parameters:
regionName -
delete -
Throws:
IOException

openScanner

long openScanner(long transactionId,
                 byte[] regionName,
                 Scan scan)
                 throws IOException
Opens a remote transactional scanner with a RowFilter.

Parameters:
regionName - name of region to scan
scan - configured scan object
Returns:
scannerId scanner identifier used in other calls
Throws:
IOException

commitRequest

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

Parameters:
regionName -
transactionId -
Returns:
status of COMMIT_OK, COMMIT_READ_ONLY, or COMMIT_UNSUSESSFULL
Throws:
IOException

commitIfPossible

boolean commitIfPossible(byte[] regionName,
                         long transactionId)
                         throws IOException
Try to commit the given transaction. This is used when there is only one participating region.

Parameters:
regionName -
transactionId -
Returns:
true if committed
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 © 2009 The Apache Software Foundation