public abstract class AbstractTransactionAwareTable extends Object implements TransactionAware
TransactionAwareHTable
implementations.| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractTransactionAwareTable.ActionChange
Record of each transaction that causes a change.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowNonTransactional |
protected Map<Long,Set<AbstractTransactionAwareTable.ActionChange>> |
changeSets |
protected TxConstants.ConflictDetection |
conflictLevel |
protected Transaction |
tx |
protected TransactionCodec |
txCodec |
| Constructor and Description |
|---|
AbstractTransactionAwareTable(TxConstants.ConflictDetection conflictLevel,
boolean allowNonTransactional) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToChangeSet(byte[] row,
byte[] family,
byte[] qualifier) |
boolean |
commitTx() |
protected abstract boolean |
doCommit()
Commits any pending writes by flushing the wrapped
HTable instance. |
protected abstract boolean |
doRollback()
Rolls back any persisted changes from the transaction by issuing offsetting deletes to the
wrapped
HTable instance. |
boolean |
getAllowNonTransactional()
True if the instance allows non-transaction operations.
|
byte[] |
getChangeKey(byte[] row,
byte[] family,
byte[] qualifier) |
protected abstract byte[] |
getTableKey()
Returns the table name to use as a key prefix for the transaction change set.
|
String |
getTransactionAwareName() |
Collection<byte[]> |
getTxChanges() |
void |
postTxCommit() |
boolean |
rollbackTx() |
void |
setAllowNonTransactional(boolean allowNonTransactional)
Set whether the instance allows non-transactional operations.
|
void |
startTx(Transaction tx) |
void |
updateTx(Transaction tx) |
protected final TransactionCodec txCodec
protected final Map<Long,Set<AbstractTransactionAwareTable.ActionChange>> changeSets
protected final TxConstants.ConflictDetection conflictLevel
protected Transaction tx
protected boolean allowNonTransactional
public AbstractTransactionAwareTable(TxConstants.ConflictDetection conflictLevel, boolean allowNonTransactional)
public boolean getAllowNonTransactional()
public void setAllowNonTransactional(boolean allowNonTransactional)
allowNonTransactional - public void startTx(Transaction tx)
startTx in interface TransactionAwarepublic void updateTx(Transaction tx)
updateTx in interface TransactionAwarepublic Collection<byte[]> getTxChanges()
getTxChanges in interface TransactionAwarepublic byte[] getChangeKey(byte[] row,
byte[] family,
byte[] qualifier)
public boolean commitTx()
throws Exception
commitTx in interface TransactionAwareExceptionprotected abstract boolean doCommit()
throws IOException
HTable instance.IOExceptionpublic void postTxCommit()
postTxCommit in interface TransactionAwarepublic String getTransactionAwareName()
getTransactionAwareName in interface TransactionAwareprotected abstract byte[] getTableKey()
public boolean rollbackTx()
throws Exception
rollbackTx in interface TransactionAwareExceptionprotected abstract boolean doRollback()
throws Exception
HTable instance. How this is handled will depend on the delete API exposed
by the specific version of HBase.Exceptionprotected void addToChangeSet(byte[] row,
byte[] family,
byte[] qualifier)
Copyright © 2015. All Rights Reserved.