import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Executor;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.DataTreeCohortActor.CanCommit;
import org.opendaylight.controller.cluster.datastore.DataTreeCohortActor.Success;
private final Executor callbackExecutor;
private final Timeout timeout;
- @Nonnull
- private List<Success> successfulFromPrevious = Collections.emptyList();
+ private @NonNull List<Success> successfulFromPrevious = Collections.emptyList();
private State state = State.IDLE;
CompositeDataTreeCohort(final DataTreeCohortActorRegistry registry, final TransactionIdentifier transactionID,
return ret;
}
- @Nonnull
- private CompletionStage<Void> processResponses(final List<Entry<ActorRef, Future<Object>>> futures,
+ private @NonNull CompletionStage<Void> processResponses(final List<Entry<ActorRef, Future<Object>>> futures,
final State currentState, final State afterState) {
LOG.debug("{}: processResponses - currentState: {}, afterState: {}", txId, currentState, afterState);
final CompletableFuture<Void> returnFuture = new CompletableFuture<>();
aggregateFuture.onComplete(new OnComplete<Iterable<Object>>() {
@Override
- public void onComplete(Throwable failure, Iterable<Object> results) {
+ public void onComplete(final Throwable failure, final Iterable<Object> results) {
callbackExecutor.execute(
() -> processResponses(failure, results, currentState, afterState, returnFuture));
}
// FB issues violation for passing null to CompletableFuture#complete but it is valid and necessary when the
// generic type is Void.
@SuppressFBWarnings("NP_NONNULL_PARAM_VIOLATION")
- private void processResponses(Throwable failure, Iterable<Object> results, State currentState, State afterState,
- CompletableFuture<Void> resultFuture) {
+ private void processResponses(final Throwable failure, final Iterable<Object> results,
+ final State currentState, final State afterState, final CompletableFuture<Void> resultFuture) {
if (failure != null) {
successfulFromPrevious = Collections.emptyList();
resultFuture.completeExceptionally(failure);
} else if (result instanceof Status.Failure) {
failed.add((Failure) result);
} else {
- LOG.warn("{}: unrecognized response {}, ignoring it", result);
+ LOG.warn("{}: unrecognized response {}, ignoring it", txId, result);
}
}