@Test public void basicTest() throws Exception { doReturn(true).when(LISTENABLE_FUTURE).get(); doReturn(LISTENABLE_FUTURE).when(DOM_STORE_THREE_PHASE_COMMIT_COHORT).canCommit(); COHORTS.add(DOM_STORE_THREE_PHASE_COMMIT_COHORT); ShardCanCommitCoordinationTask shardCanCommitCoordinationTask = new ShardCanCommitCoordinationTask(DOM_DATA_TREE_IDENTIFIER, COHORTS); shardCanCommitCoordinationTask.call(); verify(DOM_STORE_THREE_PHASE_COMMIT_COHORT).canCommit(); }
@Override public Boolean call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, canCommit started", rootShardPrefix); canCommitBlocking(); return true; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase CanCommit, starting Abort", rootShardPrefix, e); throw e; } }
ShardCanCommitCoordinationTask implements Callable<Boolean> { @Override public Boolean call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, canCommit started", rootShardPrefix); canCommitBlocking(); return true; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase CanCommit, starting Abort", rootShardPrefix, e); throw e; } } }
ShardCanCommitCoordinationTask implements Callable<Boolean> { @Override public Boolean call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, canCommit started", rootShardPrefix); canCommitBlocking(); return true; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase CanCommit, starting Abort", rootShardPrefix, e); throw e; } } ShardCanCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
                                       final Collection<DOMStoreThreePhaseCommitCohort> cohorts); }
ShardCanCommitCoordinationTask implements Callable<Boolean> { @Override public Boolean call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, canCommit started", rootShardPrefix); canCommitBlocking(); return true; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase CanCommit, starting Abort", rootShardPrefix, e); throw e; } } ShardCanCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
                                       final Collection<DOMStoreThreePhaseCommitCohort> cohorts); @Override Boolean call(); }
ShardCanCommitCoordinationTask implements Callable<Boolean> { @Override public Boolean call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, canCommit started", rootShardPrefix); canCommitBlocking(); return true; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase CanCommit, starting Abort", rootShardPrefix, e); throw e; } } ShardCanCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
                                       final Collection<DOMStoreThreePhaseCommitCohort> cohorts); @Override Boolean call();  }