import java.util.Optional;
import java.util.SortedSet;
import java.util.concurrent.CompletionStage;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.yangtools.yang.common.Empty;
private final DataTreeModification transaction;
private final ShardDataTree dataTree;
- private final TransactionIdentifier transactionId;
+ private final @NonNull TransactionIdentifier transactionId;
private final CompositeDataTreeCohort userCohorts;
private final @Nullable SortedSet<String> participatingShardNames;
}
@Override
- public TransactionIdentifier getIdentifier() {
+ TransactionIdentifier transactionId() {
return transactionId;
}
private void checkState(final State expected) {
Preconditions.checkState(state == expected, "State %s does not match expected state %s for %s",
- state, expected, getIdentifier());
+ state, expected, transactionId());
}
@Override
return;
}
- maybeAborts.get().whenComplete((noop, failure) -> {
+ maybeAborts.orElseThrow().whenComplete((noop, failure) -> {
if (failure != null) {
abortCallback.onFailure(failure);
} else {
return;
}
- maybeCanCommitFuture.get().whenComplete((noop, failure) -> {
+ maybeCanCommitFuture.orElseThrow().whenComplete((noop, failure) -> {
if (failure != null) {
futureCallback.onFailure(failure);
} else {
return;
}
- maybePreCommitFuture.get().whenComplete((noop, failure) -> {
+ maybePreCommitFuture.orElseThrow().whenComplete((noop, failure) -> {
if (failure != null) {
futureCallback.onFailure(failure);
} else {
return;
}
- maybeCommitFuture.get().whenComplete((noop, failure) -> {
+ maybeCommitFuture.orElseThrow().whenComplete((noop, failure) -> {
if (failure != null) {
LOG.error("User cohorts failed to commit", failure);
}