protected void waitForReplicationLatch(ReplicableCommand rpcCommand, Set<Class> filter) { Class cmdClass = getActualClass(rpcCommand); if (!filter.contains(cmdClass)) { return; } try { log.debugf("Replication trigger called, waiting for latch to open."); blockingLatch.open(); replicationLatch.await(); log.trace("Replication latch opened, continuing."); } catch (Exception e) { throw new RuntimeException("Unexpected exception!", e); } }
public void allowSerialization() { if (lockable) latch.open(); }
public void stopBlocking() { blockBeforeFilter = Collections.emptySet(); blockAfterFilter = Collections.emptySet(); replicationLatch.open(); }