* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.controller.cluster.databroker;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.MoreExecutors;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.common.api.TransactionChainListener;
import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
import org.slf4j.Logger;
private static final Logger LOG = LoggerFactory.getLogger(DOMBrokerTransactionChain.class);
private final AtomicLong txNum = new AtomicLong();
private final AbstractDOMBroker broker;
- private final TransactionChainListener listener;
+ private final DOMTransactionChainListener listener;
private final long chainId;
private volatile State state = State.RUNNING;
* If any of arguments is null.
*/
DOMBrokerTransactionChain(final long chainId, final Map<LogicalDatastoreType, DOMStoreTransactionChain> chains,
- final AbstractDOMBroker broker, final TransactionChainListener listener) {
+ final AbstractDOMBroker broker, final DOMTransactionChainListener listener) {
super(chains);
this.chainId = chainId;
- this.broker = Preconditions.checkNotNull(broker);
- this.listener = Preconditions.checkNotNull(listener);
+ this.broker = requireNonNull(broker);
+ this.listener = requireNonNull(listener);
}
private void checkNotFailed() {
- Preconditions.checkState(state != State.FAILED, "Transaction chain has failed");
+ checkState(state != State.FAILED, "Transaction chain has failed");
}
@Override
listener.onTransactionChainSuccessful(this);
}
+ @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/811")
private void transactionCompleted() {
if (COUNTER_UPDATER.decrementAndGet(this) == 0 && state == State.CLOSING) {
finishClose();
}
}
+ @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/811")
private void transactionFailed(final DOMDataTreeWriteTransaction tx, final Throwable cause) {
state = State.FAILED;
LOG.debug("Transaction chain {} failed.", this, cause);