@Test public void basicTest() throws Exception { doReturn(Void.TYPE).when(LISTENABLE_FUTURE).get(); doReturn(LISTENABLE_FUTURE).when(DOM_STORE_THREE_PHASE_COMMIT_COHORT).commit(); COHORTS.add(DOM_STORE_THREE_PHASE_COMMIT_COHORT); ShardCommitCoordinationTask shardCommitCoordinationTask = new ShardCommitCoordinationTask(DOM_DATA_TREE_IDENTIFIER, COHORTS, mockTx); shardCommitCoordinationTask.call(); verify(DOM_STORE_THREE_PHASE_COMMIT_COHORT).commit(); }
@Override public Void call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, commit started", rootShardPrefix); commitBlocking(); transaction.transactionCommited(transaction); return null; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase Commit, starting Abort", rootShardPrefix, e); throw e; } }
ShardCommitCoordinationTask implements Callable<Void> { @Override public Void call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, commit started", rootShardPrefix); commitBlocking(); transaction.transactionCommited(transaction); return null; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase Commit, starting Abort", rootShardPrefix, e); throw e; } } }
ShardCommitCoordinationTask implements Callable<Void> { @Override public Void call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, commit started", rootShardPrefix); commitBlocking(); transaction.transactionCommited(transaction); return null; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase Commit, starting Abort", rootShardPrefix, e); throw e; } } ShardCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
                                       final Collection<DOMStoreThreePhaseCommitCohort> cohorts,
                                       final InmemoryDOMDataTreeShardWriteTransaction transaction); }
ShardCommitCoordinationTask implements Callable<Void> { @Override public Void call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, commit started", rootShardPrefix); commitBlocking(); transaction.transactionCommited(transaction); return null; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase Commit, starting Abort", rootShardPrefix, e); throw e; } } ShardCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
                                       final Collection<DOMStoreThreePhaseCommitCohort> cohorts,
                                       final InmemoryDOMDataTreeShardWriteTransaction transaction); @Override Void call(); }
ShardCommitCoordinationTask implements Callable<Void> { @Override public Void call() throws TransactionCommitFailedException { try { LOG.debug("Shard {}, commit started", rootShardPrefix); commitBlocking(); transaction.transactionCommited(transaction); return null; } catch (final TransactionCommitFailedException e) { LOG.warn("Shard: {} Submit Error during phase Commit, starting Abort", rootShardPrefix, e); throw e; } } ShardCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
                                       final Collection<DOMStoreThreePhaseCommitCohort> cohorts,
                                       final InmemoryDOMDataTreeShardWriteTransaction transaction); @Override Void call();  }