@Override public void operationPrepared(final TransactionalProtocolClient.PreparedOperation<T> prepared) { if(! queue.offer(prepared)) { prepared.rollback(); } }
@Override public void operationPrepared(final TransactionalProtocolClient.PreparedOperation<T> prepared) { ControllerLogger.MGMT_OP_LOGGER.tracef("received prepared operation %s", prepared); if(! queue.offer(prepared)) { prepared.rollback(); } }
@Override public void operationPrepared(final TransactionalProtocolClient.PreparedOperation<T> prepared) { ControllerLogger.MGMT_OP_LOGGER.tracef("received prepared operation %s", prepared); if(! queue.offer(prepared)) { prepared.rollback(); } }
prepared.rollback(); awaitCompletion();
prepared.rollback(); awaitCompletion();
prepared.rollback(); try {
prepared.rollback(); try {
preparedOperation.rollback(); throw new OperationFailedException(result.get(FAILURE_DESCRIPTION).asString());
prepared.commit(); } else { prepared.rollback();
preparedOperation.rollback(); throw new OperationFailedException(result.get(FAILURE_DESCRIPTION).asString());
prepared.commit(); } else { prepared.rollback();
prepared.commit(); } else { prepared.rollback();
/** * Finalize the transaction. This will return {@code false} in case the local operation failed, * but the overall state of the operation is commit=true. * * @param commit {@code true} to commit, {@code false} to rollback * @return whether the local proxy operation result is in sync with the overall operation */ public boolean finalizeTransaction(boolean commit) { final boolean failed = preparedOperation.isFailed(); if(commit && failed) { return false; } if(commit) { preparedOperation.commit(); } else { if(!failed) { preparedOperation.rollback(); } } return true; }
/** * Finalize the transaction. This will return {@code false} in case the local operation failed, * but the overall state of the operation is commit=true. * * @param commit {@code true} to commit, {@code false} to rollback * @return whether the local proxy operation result is in sync with the overall operation */ public boolean finalizeTransaction(boolean commit) { final boolean failed = preparedOperation.isFailed(); if(commit && failed) { return false; } if(commit) { preparedOperation.commit(); } else { if(!failed) { preparedOperation.rollback(); } } return true; }
/** * Finalize the transaction. This will return {@code false} in case the local operation failed, * but the overall state of the operation is commit=true. * * @param commit {@code true} to commit, {@code false} to rollback * @return whether the local proxy operation result is in sync with the overall operation */ public boolean finalizeTransaction(boolean commit) { final boolean failed = preparedOperation.isFailed(); if(commit && failed) { return false; } if(commit) { preparedOperation.commit(); } else { if(!failed) { preparedOperation.rollback(); } } return true; }
@Override public void operationPrepared(final TransactionalProtocolClient.PreparedOperation<T> prepared) { ControllerLogger.MGMT_OP_LOGGER.tracef("received prepared operation %s", prepared.getOperation()); if(! queue.offer(prepared)) { prepared.rollback(); } }