|
||||||||||
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()
|
Method Summary | |
---|---|
List<WriteCommand> |
drain()
Drains the transaction log and returns a list of what has been drained. |
List<WriteCommand> |
drainAndLock()
Similar to TransactionLogger.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 |
boolean |
logIfNeeded(Collection<WriteCommand> commands)
If logging is enabled, will log the commands and return true. |
void |
logIfNeeded(CommitCommand command)
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. |
boolean |
shouldDrainWithoutLock()
Tests whether the drain() method can be called without a lock. |
void |
unlockAndDisable()
Unlocks and disables the transaction logger. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionLoggerImpl()
Method Detail |
---|
public void enable()
TransactionLogger
enable
in interface TransactionLogger
public List<WriteCommand> drain()
TransactionLogger
drain
in interface TransactionLogger
public List<WriteCommand> drainAndLock()
TransactionLogger
TransactionLogger.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 TransactionLogger
public void unlockAndDisable()
TransactionLogger
TransactionLogger.drainAndLock()
.
unlockAndDisable
in interface TransactionLogger
public boolean logIfNeeded(WriteCommand command)
TransactionLogger
logIfNeeded
in interface TransactionLogger
command
- command to log
public void logIfNeeded(PrepareCommand command)
TransactionLogger
logIfNeeded
in interface TransactionLogger
command
- PrepoareCommand to logpublic void logIfNeeded(CommitCommand command)
TransactionLogger
logIfNeeded
in interface TransactionLogger
command
- CommitCommand to logpublic void logIfNeeded(RollbackCommand command)
TransactionLogger
logIfNeeded
in interface TransactionLogger
command
- RollbackCommand to logpublic boolean logIfNeeded(Collection<WriteCommand> commands)
TransactionLogger
logIfNeeded
in interface TransactionLogger
commands
- commands to log
public boolean isEnabled()
TransactionLogger
isEnabled
in interface TransactionLogger
public boolean shouldDrainWithoutLock()
TransactionLogger
shouldDrainWithoutLock
in interface TransactionLogger
public Collection<PrepareCommand> getPendingPrepares()
TransactionLogger
getPendingPrepares
in interface TransactionLogger
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |