package org.opendaylight.controller.cluster.databroker.actors.dds;
import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
/**
* An {@link AbstractTransactionCommitCohort} for use with empty transactions. This relies on the fact that no backends
* have been touched, hence all state book-keeping needs to happen only locally and shares fate with the coordinator.
*
+ * <p>
* Therefore all methods can finish immediately without any effects.
*
* @author Robert Varga
*/
final class EmptyTransactionCommitCohort extends AbstractTransactionCommitCohort {
- static final DOMStoreThreePhaseCommitCohort INSTANCE = new EmptyTransactionCommitCohort();
-
- private EmptyTransactionCommitCohort() {
- // Hidden
+ EmptyTransactionCommitCohort(final AbstractClientHistory parent, final TransactionIdentifier txId) {
+ super(parent, txId);
}
@Override
@Override
public ListenableFuture<Void> abort() {
+ complete();
return VOID_FUTURE;
}
@Override
public ListenableFuture<Void> commit() {
+ complete();
return VOID_FUTURE;
}
}