import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import javax.annotation.concurrent.NotThreadSafe;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final class ShardDataTreeTransactionChain extends ShardDataTreeTransactionParent {
private static final Logger LOG = LoggerFactory.getLogger(ShardDataTreeTransactionChain.class);
private final ShardDataTree dataTree;
final class ShardDataTreeTransactionChain extends ShardDataTreeTransactionParent {
private static final Logger LOG = LoggerFactory.getLogger(ShardDataTreeTransactionChain.class);
private final ShardDataTree dataTree;
private ReadWriteShardDataTreeTransaction previousTx;
private ReadWriteShardDataTreeTransaction openTransaction;
private boolean closed;
private ReadWriteShardDataTreeTransaction previousTx;
private ReadWriteShardDataTreeTransaction openTransaction;
private boolean closed;
Preconditions.checkState(openTransaction == null, "Transaction %s is open", openTransaction);
if (previousTx == null) {
Preconditions.checkState(openTransaction == null, "Transaction %s is open", openTransaction);
if (previousTx == null) {
final DataTreeSnapshot snapshot = getSnapshot();
LOG.debug("Allocated read-only transaction {} snapshot {}", txId, snapshot);
return new ReadOnlyShardDataTreeTransaction(txId, snapshot);
}
final DataTreeSnapshot snapshot = getSnapshot();
LOG.debug("Allocated read-only transaction {} snapshot {}", txId, snapshot);
return new ReadOnlyShardDataTreeTransaction(txId, snapshot);
}
final DataTreeSnapshot snapshot = getSnapshot();
LOG.debug("Allocated read-write transaction {} snapshot {}", txId, snapshot);
final DataTreeSnapshot snapshot = getSnapshot();
LOG.debug("Allocated read-write transaction {} snapshot {}", txId, snapshot);