public class HBaseTransactionPruningPlugin extends Object implements TransactionPruningPlugin
TransactionPruningPlugin
for HBase.
This plugin determines the prune upper bound for transactional HBase tables that use
coprocessor TransactionProcessor
.
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.hbase.client.Connection |
connection |
protected DataJanitorState |
dataJanitorState |
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
HBaseTransactionPruningPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called once during the shutdown of the Transaction Service.
|
long |
fetchPruneUpperBound(long time,
long inactiveTransactionBound)
Determines prune upper bound for the data store as mentioned above.
|
protected SortedSet<byte[]> |
getTransactionalRegions() |
void |
initialize(org.apache.hadoop.conf.Configuration conf)
Called once when the Transaction Service starts up.
|
protected boolean |
isTransactionalTable(org.apache.hadoop.hbase.HTableDescriptor tableDescriptor) |
void |
pruneComplete(long time,
long maxPrunedInvalid)
After invalid list has been pruned, this cleans up state information that is no longer required.
|
public static final org.slf4j.Logger LOG
protected org.apache.hadoop.conf.Configuration conf
protected org.apache.hadoop.hbase.client.Connection connection
protected DataJanitorState dataJanitorState
public void initialize(org.apache.hadoop.conf.Configuration conf) throws IOException
TransactionPruningPlugin
initialize
in interface TransactionPruningPlugin
conf
- configuration for the pluginIOException
public long fetchPruneUpperBound(long time, long inactiveTransactionBound) throws IOException
fetchPruneUpperBound
in interface TransactionPruningPlugin
time
- start time of this prune iteration in millisecondsinactiveTransactionBound
- the largest invalid transaction that can be possibly removed
from the invalid list for the given time. This is an upper bound determined
by the Transaction Service, based on its knowledge of in-progress and invalid
transactions that may still have active processes and therefore future writes.
The plugin will typically return a reduced upper bound based on the state of
the invalid transaction data clean up in the data store.IOException
public void pruneComplete(long time, long maxPrunedInvalid) throws IOException
pruneComplete
in interface TransactionPruningPlugin
time
- start time of this prune iteration in milliseconds (same value as passed to
TransactionPruningPlugin.fetchPruneUpperBound(long, long)
in the same run)maxPrunedInvalid
- the largest invalid transaction that was removed from the invalid listIOException
public void destroy()
TransactionPruningPlugin
destroy
in interface TransactionPruningPlugin
protected boolean isTransactionalTable(org.apache.hadoop.hbase.HTableDescriptor tableDescriptor)
protected SortedSet<byte[]> getTransactionalRegions() throws IOException
IOException
Copyright © 2016 The Apache Software Foundation. All rights reserved.