|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.distribution.TransactionLoggerImpl
public class TransactionLoggerImpl
A transaction logger to log ongoing transactions in an efficient and thread-safe manner while a rehash is going on.
Transaction logs can then be replayed after the state transferred during a rehash has been written.
| Constructor Summary | |
|---|---|
TransactionLoggerImpl(CommandsFactory cf)
|
|
| Method Summary | |
|---|---|
void |
blockNewTransactions()
Causes new transactions to block when testing isEnabled(). |
List<WriteCommand> |
drain()
Drains the transaction log and returns a list of what has been drained. |
List<WriteCommand> |
drainAndLock(Address lockedFor)
Similar to RemoteTransactionLogger.drain() except that relevant locks are acquired so that no more commands are added to the
transaction log during this process, and transaction logging is disabled after draining. |
void |
enable()
Enables transaction logging |
Collection<PrepareCommand> |
getPendingPrepares()
Drains pending prepares. |
boolean |
isEnabled()
Checks whether transaction logging is enabled |
void |
logIfNeeded(CommitCommand command,
TxInvocationContext context)
Logs a CommitCommand if needed. |
void |
logIfNeeded(PrepareCommand command)
Logs a PrepareCommand if needed. |
void |
logIfNeeded(RollbackCommand command)
Logs a RollbackCommand if needed. |
boolean |
logIfNeeded(WriteCommand command)
If logging is enabled, will log the command and return true. |
void |
logModificationsIfNeeded(CommitCommand commit,
TxInvocationContext context)
A mechanism for commit commands to register modifications instead of a prepare. |
boolean |
shouldDrainWithoutLock()
Tests whether the drain() method can be called without a lock. |
String |
toString()
|
void |
unblockNewTransactions()
Unblocks anything blocking on isEnabled(). |
void |
unlockAndDisable(Address lockedFor)
Unlocks and disables the transaction logger. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionLoggerImpl(CommandsFactory cf)
| Method Detail |
|---|
public void enable()
TransactionLogger
enable in interface TransactionLoggerpublic List<WriteCommand> drain()
RemoteTransactionLogger
drain in interface RemoteTransactionLoggerpublic List<WriteCommand> drainAndLock(Address lockedFor)
RemoteTransactionLoggerRemoteTransactionLogger.drain() except that relevant locks are acquired so that no more commands are added to the
transaction log during this process, and transaction logging is disabled after draining.
drainAndLock in interface RemoteTransactionLoggerpublic void unlockAndDisable(Address lockedFor)
RemoteTransactionLogger#drainAndLock().
unlockAndDisable in interface RemoteTransactionLoggerpublic boolean logIfNeeded(WriteCommand command)
TransactionLogger
logIfNeeded in interface TransactionLoggercommand - command to log
public void logIfNeeded(PrepareCommand command)
TransactionLogger
logIfNeeded in interface TransactionLoggercommand - PrepoareCommand to log
public void logModificationsIfNeeded(CommitCommand commit,
TxInvocationContext context)
TransactionLogger
logModificationsIfNeeded in interface TransactionLoggercommit - commit commandcontext - context from which to extract modification list
public void logIfNeeded(CommitCommand command,
TxInvocationContext context)
TransactionLogger
logIfNeeded in interface TransactionLoggercommand - CommitCommand to logpublic void logIfNeeded(RollbackCommand command)
TransactionLogger
logIfNeeded in interface TransactionLoggercommand - RollbackCommand to logpublic boolean isEnabled()
TransactionLogger
isEnabled in interface TransactionLoggerpublic boolean shouldDrainWithoutLock()
RemoteTransactionLogger
shouldDrainWithoutLock in interface RemoteTransactionLoggerpublic Collection<PrepareCommand> getPendingPrepares()
RemoteTransactionLogger
getPendingPrepares in interface RemoteTransactionLoggerpublic void blockNewTransactions()
TransactionLogger
blockNewTransactions in interface TransactionLoggerpublic void unblockNewTransactions()
TransactionLogger
unblockNewTransactions in interface TransactionLoggerpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||