package org.opendaylight.mdsal.dom.store.inmemory;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.annotations.Beta;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collection;
import java.util.concurrent.Callable;
import org.slf4j.LoggerFactory;
/**
- * Task that coordinates the CanCommit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s
+ * Task that coordinates the CanCommit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s.
*/
@Beta
public class ShardCanCommitCoordinationTask implements Callable<Boolean> {
public ShardCanCommitCoordinationTask(final DOMDataTreeIdentifier rootShardPrefix,
final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
- this.rootShardPrefix = Preconditions.checkNotNull(rootShardPrefix);
- this.cohorts = Preconditions.checkNotNull(cohorts);
+ this.rootShardPrefix = requireNonNull(rootShardPrefix);
+ this.cohorts = requireNonNull(cohorts);
}
@Override
private ListenableFuture<?>[] canCommitAll() {
final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohorts.size()];
- int i = 0;
+ int index = 0;
for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) {
- ops[i++] = cohort.canCommit();
+ ops[index++] = cohort.canCommit();
}
return ops;
}