/** It notifies the end of the state transfer possibly unblock waiting prepares. */ public final void notifyStateTransferEnd() { TotalOrderLatch block = stateTransferInProgress.getAndSet(null); if (block != null) { block.unBlock(); } if (trace) { log.tracef("State Transfer finish. It will release %s", block); } totalOrderExecutor.checkForReadyTasks(); }
/** * Release the locked key possibly unblock waiting prepares. * * @param state the state */ public final void release(TotalOrderRemoteTransactionState state) { TotalOrderLatch synchronizedBlock = state.getTransactionSynchronizedBlock(); if (synchronizedBlock == null) { // already released! return; } Collection<Object> lockedKeys = state.getLockedKeys(); synchronizedBlock.unBlock(); for (Object key : lockedKeys) { keysLocked.remove(key, synchronizedBlock); } if (trace) { log.tracef( "Release %s and locked keys %s. Checking pending tasks!", synchronizedBlock, lockedKeys); } state.reset(); }