public interface TransactionSystemClient
TransactionAware
.
todo: explain Omid.Modifier and Type | Method and Description |
---|---|
void |
abort(Transaction tx)
Makes transaction visible.
|
boolean |
canCommit(Transaction tx,
Collection<byte[]> changeIds)
Deprecated.
since 0.13-incubating; use
canCommitOrThrow(Transaction, Collection) instead |
void |
canCommitOrThrow(Transaction tx,
Collection<byte[]> changeIds)
Checks if transaction with the set of changes can be committed.
|
Transaction |
checkpoint(Transaction tx)
Performs a checkpoint operation on the current transaction, returning a new Transaction instance with the
updated state.
|
boolean |
commit(Transaction tx)
Deprecated.
as of 0.13-incubating. Use
canCommitOrThrow(Transaction, Collection) instead. |
void |
commitOrThrow(Transaction tx)
Makes transaction visible.
|
int |
getInvalidSize() |
InputStream |
getSnapshotInputStream()
Retrieves the state of the transaction manager and send it as a stream.
|
boolean |
invalidate(long tx)
Makes transaction invalid.
|
void |
pruneNow()
Trigger transaction pruning now.
|
void |
resetState()
Resets the state of the transaction manager.
|
Transaction |
startLong()
Starts new long transaction.
|
Transaction |
startShort()
Starts new short transaction.
|
Transaction |
startShort(int timeout)
Starts new short transaction.
|
String |
status()
Return the status of the transaction Manager
|
boolean |
truncateInvalidTx(Set<Long> invalidTxIds)
Removes the given transaction ids from the invalid list.
|
boolean |
truncateInvalidTxBefore(long time)
Removes all transaction ids started before the given time from invalid list.
|
Transaction startShort()
Transaction
Transaction startShort(int timeout)
timeout
- the timeout for the transactionTransaction
IllegalArgumentException
- if the provided timeout is negative or exceeds the configured maximumTransaction startLong()
Transaction
@Deprecated boolean canCommit(Transaction tx, Collection<byte[]> changeIds) throws TransactionNotInProgressException
canCommitOrThrow(Transaction, Collection)
insteadcommitOrThrow(Transaction)
which will check conflicts again to avoid races.
Since we do conflict detection at commit time as well, this may seem redundant. The idea is to check for conflicts
before we persist changes to avoid rollback in case of conflicts as much as possible.
NOTE: in some situations we may want to skip this step to save on RPC with a risk of many rollback ops. So by
default we take safe path.tx
- transaction to verifychangeIds
- ids of changes made by transactionTransactionNotInProgressException
- if the transaction is not in progress; most likely it has timed out.void canCommitOrThrow(Transaction tx, Collection<byte[]> changeIds) throws TransactionFailureException
commitOrThrow(Transaction)
which will check conflicts again to avoid races.
Since we do conflict detection at commit time as well, this may seem redundant. The idea is to check for conflicts
before we persist changes to avoid rollback in case of conflicts as much as possible.
NOTE: in some situations we may want to skip this step to save on RPC with a risk of many rollback ops. So by
default we take safe path.tx
- transaction to verifychangeIds
- ids of changes made by transactionTransactionSizeException
- if the size of the change set exceeds the allowed limitTransactionConflictException
- if the change set has a conflict with an overlapping transactionTransactionNotInProgressException
- if the transaction is not in progress; most likely it has timed outTransactionFailureException
@Deprecated boolean commit(Transaction tx) throws TransactionNotInProgressException
canCommitOrThrow(Transaction, Collection)
instead.canCommitOrThrow(Transaction, java.util.Collection)
tx
- transaction to make visible.TransactionNotInProgressException
void commitOrThrow(Transaction tx) throws TransactionFailureException
canCommitOrThrow(Transaction, java.util.Collection)
tx
- transaction to make visible.TransactionConflictException
- if the transaction has a conflict with an overlapping transactionTransactionNotInProgressException
- if the transaction is not in progress; most likely it has timed outTransactionFailureException
void abort(Transaction tx)
TransactionNotInProgressException
if transaction has timed out.tx
- transaction to make visible.boolean invalidate(long tx)
TransactionNotInProgressException
if transaction has timed out.tx
- transaction id to invalidate.Transaction checkpoint(Transaction tx) throws TransactionNotInProgressException
tx
- the current transaction to checkpointTransactionNotInProgressException
InputStream getSnapshotInputStream() throws TransactionCouldNotTakeSnapshotException
TransactionCouldNotTakeSnapshotException
String status()
void resetState()
boolean truncateInvalidTx(Set<Long> invalidTxIds)
invalidTxIds
- transaction idsboolean truncateInvalidTxBefore(long time) throws InvalidTruncateTimeException
time
- time in millisecondsInvalidTruncateTimeException
- if there are any in-progress transactions started before given timeint getInvalidSize()
void pruneNow()
Copyright © 2017 The Apache Software Foundation. All rights reserved.