swamirishi commented on code in PR #8781:
URL: https://github.com/apache/ozone/pull/8781#discussion_r2198424626
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHADBTransactionBufferImpl.java:
##########
@@ -49,43 +54,57 @@ public class SCMHADBTransactionBufferImpl implements
SCMHADBTransactionBuffer {
private SCMMetadataStore metadataStore;
private BatchOperation currentBatchOperation;
private TransactionInfo latestTrxInfo;
- private final AtomicReference<SnapshotInfo> latestSnapshot
- = new AtomicReference<>();
+ private final AtomicReference<SnapshotInfo> latestSnapshot = new
AtomicReference<>();
private final AtomicLong txFlushPending = new AtomicLong(0);
private long lastSnapshotTimeMs = 0;
- private final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
+ private final Map<String, Integer> tableIdxMap;
Review Comment:
2 objects as in? Are you talking about sync between the map and the stripe
lock. I did it just to ensure if the entry is not there in the map we atleast
use the lock index at 0. Moreover it is easier to acquire a full stripe lock in
the same order. In this case we might also be able to multi table lock in
future if we want to update all the values under a lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]