org.infinispan.distribution
Interface RemoteTransactionLogger

All Known Subinterfaces:
TransactionLogger
All Known Implementing Classes:
RemoteTransactionLoggerImpl, TransactionLoggerImpl

public interface RemoteTransactionLogger

This abstraction performs RPCs and works on a TransactionLogger located on a remote node.

Since:
4.2.1
Author:
Manik Surtani

Method Summary
 List<WriteCommand> drain()
          Drains the transaction log and returns a list of what has been drained.
 List<WriteCommand> drainAndLock(Address lockFor)
          Similar to 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.
 Collection<PrepareCommand> getPendingPrepares()
          Drains pending prepares.
 boolean shouldDrainWithoutLock()
          Tests whether the drain() method can be called without a lock.
 void unlockAndDisable(Address lockedFor)
          Unlocks and disables the transaction logger.
 

Method Detail

drain

List<WriteCommand> drain()
Drains the transaction log and returns a list of what has been drained.

Returns:
a list of drained commands

drainAndLock

List<WriteCommand> drainAndLock(Address lockFor)
Similar to 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.

Returns:
list of drained commands

shouldDrainWithoutLock

boolean shouldDrainWithoutLock()
Tests whether the drain() method can be called without a lock. This is usually true if there is a lot of stuff to drain. After a certain threshold (once there are relatively few entries in the tx log) this will return false after which you should call drainAndLock() to clear the final parts of the log.

Returns:
true if drain() should be called, false if drainAndLock() should be called.

getPendingPrepares

Collection<PrepareCommand> getPendingPrepares()
Drains pending prepares. Note that this should *only* be done after calling drainAndLock() to prevent race conditions

Returns:
a list of prepares pending commit or rollback

unlockAndDisable

void unlockAndDisable(Address lockedFor)
Unlocks and disables the transaction logger. Should only be called after #drainAndLock().



Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.