@Override public Object getIdentifier() { return delegate().getIdentifier(); }
@Override public Object getIdentifier() { return delegate().getIdentifier(); }
@Override public Object getIdentifier() { return delegate().getIdentifier(); }
@Override public void onFailure(Throwable t) { LOG.error("Tx: {} Error during Abort.", transaction.getIdentifier(), t); // Propagate the original exception as that is what caused the Tx to fail and is // what's interesting to the client. clientSubmitFuture.setException(clientException); } }, MoreExecutors.directExecutor());
@Override public Object getIdentifier() { if (AuthzServiceImpl.isAuthorized(ActionType.GetIdentifier)) { return domDataWriteTransaction.getIdentifier(); } return null; } }
@Override public Void call() throws TransactionCommitFailedException { final long startTime = commitStatTracker != null ? System.nanoTime() : 0; Phase phase = Phase.canCommit; try { LOG.debug("Transaction {}: canCommit Started", tx.getIdentifier()); canCommitBlocking(); phase = Phase.preCommit; LOG.debug("Transaction {}: preCommit Started", tx.getIdentifier()); preCommitBlocking(); phase = Phase.doCommit; LOG.debug("Transaction {}: doCommit Started", tx.getIdentifier()); commitBlocking(); LOG.debug("Transaction {}: doCommit completed", tx.getIdentifier()); return null; } catch (final TransactionCommitFailedException e) { LOG.warn("Tx: {} Error during phase {}, starting Abort", tx.getIdentifier(), phase, e); abortBlocking(e); throw e; } finally { if (commitStatTracker != null) { commitStatTracker.addDuration(System.nanoTime() - startTime); } } }
abortAsyncAll().get(); } catch (InterruptedException | ExecutionException e) { LOG.error("Tx: {} Error during Abort.", tx.getIdentifier(), e); cause = new IllegalStateException("Abort failed.", e); cause.addSuppressed(e);
@Override protected CheckedFuture<Void, TransactionCommitFailedException> submit(DOMDataWriteTransaction transaction, Collection<DOMStoreThreePhaseCommitCohort> cohorts) { Preconditions.checkArgument(transaction != null, "Transaction must not be null."); Preconditions.checkArgument(cohorts != null, "Cohorts must not be null."); LOG.debug("Tx: {} is submitted for execution.", transaction.getIdentifier()); if(cohorts.isEmpty()){ return Futures.immediateCheckedFuture(null); } final AsyncNotifyingSettableFuture clientSubmitFuture = new AsyncNotifyingSettableFuture(clientFutureCallbackExecutor); doCanCommit(clientSubmitFuture, transaction, cohorts); return MappingCheckedFuture.create(clientSubmitFuture, TransactionCommitFailedExceptionMapper.COMMIT_ERROR_MAPPER); }
@Override protected CheckedFuture<Void,TransactionCommitFailedException> submit(final DOMDataWriteTransaction transaction, final Collection<DOMStoreThreePhaseCommitCohort> cohorts) { Preconditions.checkArgument(transaction != null, "Transaction must not be null."); Preconditions.checkArgument(cohorts != null, "Cohorts must not be null."); LOG.debug("Tx: {} is submitted for execution.", transaction.getIdentifier()); ListenableFuture<Void> commitFuture = null; try { commitFuture = executor.submit(new CommitCoordinationTask(transaction, cohorts, commitStatsTracker)); } catch(RejectedExecutionException e) { LOG.error("The commit executor's queue is full - submit task was rejected. \n" + executor, e); return Futures.immediateFailedCheckedFuture( new TransactionCommitFailedException( "Could not submit the commit task - the commit queue capacity has been exceeded.", e)); } return MappingCheckedFuture.create(commitFuture, TransactionCommitFailedExceptionMapper.COMMIT_ERROR_MAPPER); } }
LOG.warn("Tx: {} Error during phase {}, starting Abort", transaction.getIdentifier(), phase, t); final Exception e; if(t instanceof NoShardLeaderException || t instanceof ShardLeaderNotRespondingException) {