public interface TransactionPruningPlugin
prune-upper-bound = min(max(invalid list), min(in-progress list) - 1)where invalid list and in-progress list are from the transaction snapshot used to clean up the invalid data in the data store. There will be one such plugin per data store. The plugins will be executed as part of the Transaction Service. Each plugin will be invoked periodically to fetch the prune upper bound for its data store. Invalid transaction list can pruned up to the minimum of prune upper bounds returned by all the plugins.
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called once during the shutdown of the Transaction Service.
|
long |
fetchPruneUpperBound(long time,
long inactiveTransactionBound)
Called periodically to fetch prune upper bound for a data store.
|
void |
initialize(org.apache.hadoop.conf.Configuration conf)
Called once when the Transaction Service starts up.
|
void |
pruneComplete(long time,
long maxPrunedInvalid)
Called after successfully pruning the invalid list using the prune upper bound returned by
fetchPruneUpperBound(long, long) . |
void initialize(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- configuration for the pluginIOException
long fetchPruneUpperBound(long time, long inactiveTransactionBound) throws IOException
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
void pruneComplete(long time, long maxPrunedInvalid) throws IOException
fetchPruneUpperBound(long, long)
.
The largest invalid transaction that was removed from the invalid list is passed as a parameter in this call.
The plugin can use this information to clean up its state.time
- start time of this prune iteration in milliseconds (same value as passed to
fetchPruneUpperBound(long, long)
in the same run)maxPrunedInvalid
- the largest invalid transaction that was removed from the invalid listIOException
void destroy()
Copyright © 2016 The Apache Software Foundation. All rights reserved.