/** * Indicates that a channel has received a BLOCK event from FLUSH protocol. */ public void block() { if (!configuration.isNonBlockingStateTransfer()) { try { if (log.isDebugEnabled()) log.debug("Block received at " + getLocalAddress()); flushTracker.block(); notifier.notifyCacheBlocked(true); notifier.notifyCacheBlocked(false); if (log.isDebugEnabled()) log.debug("Block processed at " + getLocalAddress()); } catch (Throwable e) { //do not rethrow! jgroups might behave funny, resulting even in deadlock log.error("Error found while processing block()", e); } } }
/** * Mimics a partial flush between the current instance and the address to flush, by opening and closing the necessary * latches on both ends. * @param addressToFlush address to flush in addition to the current address * @param block if true, mimics setting a flush. Otherwise, mimics un-setting a flush. * @throws Exception if there are issues */ private void mimicPartialFlushViaRPC(Address addressToFlush, boolean block) throws Exception { StateTransferControlCommand cmd = commandsFactory.buildStateTransferControlCommand(block); Vector<Address> recipient = new Vector<Address>(); recipient.add(addressToFlush); if (!block) rpcManager.getFlushTracker().unblock(); rpcManager.callRemoteMethods(recipient, cmd, true, cfg.getStateRetrievalTimeout(), true); if (block) rpcManager.getFlushTracker().block(); }
public Object perform(InvocationContext ctx) throws Throwable { if (enabled) rpcManager.getFlushTracker().block(); else rpcManager.getFlushTracker().unblock(); return null; }