import com.google.common.base.Preconditions;
import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+import org.opendaylight.controller.cluster.datastore.persisted.AbortTransactionPayload;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
import org.slf4j.Logger;
parent.abortTransaction(this, callback);
}
- final void purge(final Runnable callback) {
- if (!closed) {
- LOG.warn("Purging unclosed transaction {}", id);
+ /**
+ * This method is exposed for sake of {@link ShardTransaction}, which is an actor. We need to ensure that
+ * the parent is updated to reflect the transaction has been closed, but no journal actions may be invoked.
+ *
+ * <p>
+ * ShardTransaction is responsible for additionally sending a request to persist an {@link AbortTransactionPayload}
+ * via a message to the Shard actor.
+ */
+ final void abortFromTransactionActor() {
+ if (close()) {
+ parent.abortFromTransactionActor(this);
}
- parent.purgeTransaction(id, callback);
}
@Override