clintropolis commented on code in PR #18176:
URL: https://github.com/apache/druid/pull/18176#discussion_r2289055193


##########
server/src/main/java/org/apache/druid/segment/loading/StorageLocation.java:
##########
@@ -47,17 +85,30 @@ public class StorageLocation
   private final long maxSizeBytes;
   private final long freeSpaceToKeep;
 
+  private final ConcurrentHashMap<CacheEntryIdentifier, CacheEntry> 
staticCacheEntries = new ConcurrentHashMap<>();
+  private final ConcurrentHashMap<CacheEntryIdentifier, WeakCacheEntry> 
weakCacheEntries = new ConcurrentHashMap<>();
+
+  @GuardedBy("lock")
+  private WeakCacheEntry head;
+  @GuardedBy("lock")
+  private WeakCacheEntry tail;
+  @GuardedBy("lock")
+  private WeakCacheEntry hand;
+
   /**
-   * Set of files stored under the {@link #path}.
+   * Current total size of files in bytes, including weak entries.
    */
-  @GuardedBy("this")
-  private final Set<File> files = new HashSet<>();
+  private final AtomicLong currSizeBytes = new AtomicLong(0);
+
+  @GuardedBy("lock")
+  private long currWeakSizeBytes = 0;

Review Comment:
   yea, i have some metrics in mind to emit in the future involving this and 
the `Stats` class i have added since your last review, but for now is just used 
in tests



-- 
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]

Reply via email to