@NotThreadSafe
final class ShardDataTreeTransactionChain extends ShardDataTreeTransactionParent
implements Identifiable<LocalHistoryIdentifier> {
+
private static final Logger LOG = LoggerFactory.getLogger(ShardDataTreeTransactionChain.class);
private final LocalHistoryIdentifier chainId;
private final ShardDataTree dataTree;
Preconditions.checkState(openTransaction == null, "Transaction %s is open", openTransaction);
if (previousTx == null) {
+ LOG.debug("Opening an unchained snapshot in {}", chainId);
return dataTree.takeSnapshot();
- } else {
- return previousTx.getSnapshot();
}
+
+ LOG.debug("Reusing a chained snapshot in {}", chainId);
+ return previousTx.getSnapshot();
}
ReadOnlyShardDataTreeTransaction newReadOnlyTransaction(final TransactionIdentifier txId) {
void close() {
closed = true;
+ LOG.debug("Closing chain {}", chainId);
}
@Override