DonalEvans commented on a change in pull request #7234:
URL: https://github.com/apache/geode/pull/7234#discussion_r780541411
##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java
##########
@@ -7642,4 +7652,23 @@ public void sendTo(DataOutput out) throws IOException {
}
+ /**
+ * Used to track all information's about live entries that region has in
this oplog.
+ * That information is only needed until oplog is compacted. This is because
compaction will
+ * clear all live entries from this oplog.
+ */
+ private static class RegionMap {
+
+ final AtomicReference<ConcurrentMap<Long, DiskRegionInfo>> regionMap =
+ new AtomicReference<>(new ConcurrentHashMap<>());
+
+ public void close() {
+ regionMap.set(null);
Review comment:
Rather than setting the reference to null here and then creating and
returning a `new ConcurrentHashMap` on every subsequent `get()` call, would it
be more efficient to instead have `close()` simply set the reference to be a
`new ConcurrentHashMap`? If this would work, then there isn't any need for this
inner class, as the call to `regionMap.close()` can just be `regionMap.set(new
ConcurrentHashMap<>())`
--
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]