public class TransactionAwareHTable extends AbstractTransactionAwareTable implements TransactionAware
AbstractTransactionAwareTable.ActionChange
allowNonTransactional, changeSets, conflictLevel, pre014ChangeSetKey, SEPARATOR_BYTE_ARRAY, tx, txCodec
Constructor and Description |
---|
TransactionAwareHTable(HTableInterface hTable)
Create a transactional aware instance of the passed HTable
|
TransactionAwareHTable(HTableInterface hTable,
boolean allowNonTransactional)
Create a transactional aware instance of the passed HTable, with the option
of allowing non-transactional operations.
|
TransactionAwareHTable(HTableInterface hTable,
TxConstants.ConflictDetection conflictLevel)
Create a transactional aware instance of the passed HTable
|
TransactionAwareHTable(HTableInterface hTable,
TxConstants.ConflictDetection conflictLevel,
boolean allowNonTransactional)
Create a transactional aware instance of the passed HTable, with the option
of allowing non-transactional operations.
|
Modifier and Type | Method and Description |
---|---|
void |
addToOperation(org.apache.hadoop.hbase.client.OperationWithAttributes op,
Transaction tx) |
org.apache.hadoop.hbase.client.Result |
append(org.apache.hadoop.hbase.client.Append append) |
Object[] |
batch(List<? extends org.apache.hadoop.hbase.client.Row> actions) |
void |
batch(List<? extends org.apache.hadoop.hbase.client.Row> actions,
Object[] results) |
<R> Object[] |
batchCallback(List<? extends org.apache.hadoop.hbase.client.Row> actions,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) |
<R> void |
batchCallback(List<? extends org.apache.hadoop.hbase.client.Row> actions,
Object[] results,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) |
boolean |
checkAndDelete(byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
org.apache.hadoop.hbase.client.Delete delete) |
boolean |
checkAndPut(byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
org.apache.hadoop.hbase.client.Put put) |
void |
close() |
org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel |
coprocessorService(byte[] row) |
<T extends com.google.protobuf.Service,R> |
coprocessorService(Class<T> service,
byte[] startKey,
byte[] endKey,
org.apache.hadoop.hbase.client.coprocessor.Batch.Call<T,R> callable) |
<T extends com.google.protobuf.Service,R> |
coprocessorService(Class<T> service,
byte[] startKey,
byte[] endKey,
org.apache.hadoop.hbase.client.coprocessor.Batch.Call<T,R> callable,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) |
void |
delete(org.apache.hadoop.hbase.client.Delete delete) |
void |
delete(List<org.apache.hadoop.hbase.client.Delete> deletes) |
protected boolean |
doCommit()
Commits any pending writes by flushing the wrapped
HTable instance. |
protected boolean |
doRollback()
Rolls back any persisted changes from the transaction by issuing offsetting deletes to the
wrapped
HTable instance. |
boolean |
exists(org.apache.hadoop.hbase.client.Get get) |
Boolean[] |
exists(List<org.apache.hadoop.hbase.client.Get> gets) |
void |
flushCommits() |
org.apache.hadoop.hbase.client.Result |
get(org.apache.hadoop.hbase.client.Get get) |
org.apache.hadoop.hbase.client.Result[] |
get(List<org.apache.hadoop.hbase.client.Get> gets) |
org.apache.hadoop.conf.Configuration |
getConfiguration() |
org.apache.hadoop.hbase.TableName |
getName() |
org.apache.hadoop.hbase.client.Result |
getRowOrBefore(byte[] row,
byte[] family) |
org.apache.hadoop.hbase.client.ResultScanner |
getScanner(byte[] family) |
org.apache.hadoop.hbase.client.ResultScanner |
getScanner(byte[] family,
byte[] qualifier) |
org.apache.hadoop.hbase.client.ResultScanner |
getScanner(org.apache.hadoop.hbase.client.Scan scan) |
org.apache.hadoop.hbase.HTableDescriptor |
getTableDescriptor() |
protected byte[] |
getTableKey()
Returns the table name to use as a key prefix for the transaction change set.
|
byte[] |
getTableName() |
long |
getWriteBufferSize() |
org.apache.hadoop.hbase.client.Result |
increment(org.apache.hadoop.hbase.client.Increment increment) |
long |
incrementColumnValue(byte[] row,
byte[] family,
byte[] qualifier,
long amount) |
long |
incrementColumnValue(byte[] row,
byte[] family,
byte[] qualifier,
long amount,
boolean writeToWAL) |
long |
incrementColumnValue(byte[] row,
byte[] family,
byte[] qualifier,
long amount,
org.apache.hadoop.hbase.client.Durability durability) |
boolean |
isAutoFlush() |
protected void |
makeRollbackOperation(org.apache.hadoop.hbase.client.Delete delete) |
void |
mutateRow(org.apache.hadoop.hbase.client.RowMutations rm) |
void |
put(List<org.apache.hadoop.hbase.client.Put> puts) |
void |
put(org.apache.hadoop.hbase.client.Put put) |
void |
setAutoFlush(boolean autoFlush) |
void |
setAutoFlush(boolean autoFlush,
boolean clearBufferOnFail) |
void |
setAutoFlushTo(boolean autoFlush) |
void |
setWriteBufferSize(long writeBufferSize) |
addToChangeSet, commitTx, getAllowNonTransactional, getChangeKey, getTransactionAwareName, getTxChanges, getVIntBytes, postTxCommit, rollbackTx, setAllowNonTransactional, startTx, updateTx
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
commitTx, getTransactionAwareName, getTxChanges, postTxCommit, rollbackTx, startTx, updateTx
public TransactionAwareHTable(HTableInterface hTable)
hTable
- underlying HBase table to usepublic TransactionAwareHTable(HTableInterface hTable, TxConstants.ConflictDetection conflictLevel)
hTable
- underlying HBase table to useconflictLevel
- level of conflict detection to perform (defaults to COLUMN
)public TransactionAwareHTable(HTableInterface hTable, boolean allowNonTransactional)
hTable
- underlying HBase table to useallowNonTransactional
- if true, additional operations (checkAndPut, increment, checkAndDelete)
will be available, though non-transactionalpublic TransactionAwareHTable(HTableInterface hTable, TxConstants.ConflictDetection conflictLevel, boolean allowNonTransactional)
hTable
- underlying HBase table to useconflictLevel
- level of conflict detection to perform (defaults to COLUMN
)allowNonTransactional
- if true, additional operations (checkAndPut, increment, checkAndDelete)
will be available, though non-transactionalprotected byte[] getTableKey()
AbstractTransactionAwareTable
getTableKey
in class AbstractTransactionAwareTable
protected boolean doCommit() throws IOException
AbstractTransactionAwareTable
HTable
instance.doCommit
in class AbstractTransactionAwareTable
IOException
protected boolean doRollback() throws Exception
AbstractTransactionAwareTable
HTable
instance. How this is handled will depend on the delete API exposed
by the specific version of HBase.doRollback
in class AbstractTransactionAwareTable
Exception
public byte[] getTableName()
public org.apache.hadoop.hbase.TableName getName()
public org.apache.hadoop.conf.Configuration getConfiguration()
public org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor() throws IOException
IOException
public boolean exists(org.apache.hadoop.hbase.client.Get get) throws IOException
IOException
public Boolean[] exists(List<org.apache.hadoop.hbase.client.Get> gets) throws IOException
IOException
public void batch(List<? extends org.apache.hadoop.hbase.client.Row> actions, Object[] results) throws IOException, InterruptedException
IOException
InterruptedException
public Object[] batch(List<? extends org.apache.hadoop.hbase.client.Row> actions) throws IOException, InterruptedException
IOException
InterruptedException
public <R> void batchCallback(List<? extends org.apache.hadoop.hbase.client.Row> actions, Object[] results, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) throws IOException, InterruptedException
IOException
InterruptedException
public <R> Object[] batchCallback(List<? extends org.apache.hadoop.hbase.client.Row> actions, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) throws IOException, InterruptedException
IOException
InterruptedException
public org.apache.hadoop.hbase.client.Result get(org.apache.hadoop.hbase.client.Get get) throws IOException
IOException
public org.apache.hadoop.hbase.client.Result[] get(List<org.apache.hadoop.hbase.client.Get> gets) throws IOException
IOException
public org.apache.hadoop.hbase.client.Result getRowOrBefore(byte[] row, byte[] family) throws IOException
IOException
public org.apache.hadoop.hbase.client.ResultScanner getScanner(org.apache.hadoop.hbase.client.Scan scan) throws IOException
IOException
public org.apache.hadoop.hbase.client.ResultScanner getScanner(byte[] family) throws IOException
IOException
public org.apache.hadoop.hbase.client.ResultScanner getScanner(byte[] family, byte[] qualifier) throws IOException
IOException
public void put(org.apache.hadoop.hbase.client.Put put) throws IOException
IOException
public void put(List<org.apache.hadoop.hbase.client.Put> puts) throws IOException
IOException
public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, org.apache.hadoop.hbase.client.Put put) throws IOException
IOException
public void delete(org.apache.hadoop.hbase.client.Delete delete) throws IOException
IOException
public void delete(List<org.apache.hadoop.hbase.client.Delete> deletes) throws IOException
IOException
public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, org.apache.hadoop.hbase.client.Delete delete) throws IOException
IOException
public void mutateRow(org.apache.hadoop.hbase.client.RowMutations rm) throws IOException
IOException
public org.apache.hadoop.hbase.client.Result append(org.apache.hadoop.hbase.client.Append append) throws IOException
IOException
public org.apache.hadoop.hbase.client.Result increment(org.apache.hadoop.hbase.client.Increment increment) throws IOException
IOException
public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException
IOException
public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, org.apache.hadoop.hbase.client.Durability durability) throws IOException
IOException
public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException
IOException
public boolean isAutoFlush()
public void flushCommits() throws IOException
IOException
public void close() throws IOException
IOException
public org.apache.hadoop.hbase.ipc.CoprocessorRpcChannel coprocessorService(byte[] row)
public <T extends com.google.protobuf.Service,R> Map<byte[],R> coprocessorService(Class<T> service, byte[] startKey, byte[] endKey, org.apache.hadoop.hbase.client.coprocessor.Batch.Call<T,R> callable) throws com.google.protobuf.ServiceException, Throwable
com.google.protobuf.ServiceException
Throwable
public <T extends com.google.protobuf.Service,R> void coprocessorService(Class<T> service, byte[] startKey, byte[] endKey, org.apache.hadoop.hbase.client.coprocessor.Batch.Call<T,R> callable, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) throws com.google.protobuf.ServiceException, Throwable
com.google.protobuf.ServiceException
Throwable
public void setAutoFlush(boolean autoFlush)
public void setAutoFlush(boolean autoFlush, boolean clearBufferOnFail)
public void setAutoFlushTo(boolean autoFlush)
public long getWriteBufferSize()
public void setWriteBufferSize(long writeBufferSize) throws IOException
IOException
public void addToOperation(org.apache.hadoop.hbase.client.OperationWithAttributes op, Transaction tx) throws IOException
IOException
protected void makeRollbackOperation(org.apache.hadoop.hbase.client.Delete delete)
Copyright © 2018 The Apache Software Foundation. All rights reserved.