Apache9 commented on code in PR #5545:
URL: https://github.com/apache/hbase/pull/5545#discussion_r1577103908


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/DefaultStoreFileManager.java:
##########
@@ -86,13 +111,20 @@ public Collection<HStoreFile> getCompactedfiles() {
   }
 
   @Override
-  public void insertNewFiles(Collection<HStoreFile> sfs) {
+  public void insertNewFiles(Collection<HStoreFile> sfs) throws IOException {
+    if (enableLiveFileTracking) {
+      this.liveStoreFiles = 
ImmutableList.sortedCopyOf(getStoreFileComparator(),

Review Comment:
   I suggest that, we introduce a something like a Pair for storing all 
storefiles and live storefiles in a single field, and mark it as volatile, so 
the reader can get always get a consistent view. Something like
   
   ```
   class StoreFileList {
     @Nonnull
     final ImmutableList<HStoreFile> storefiles;
     @Nullable
     final ImmutableList<HStoreFile> liveStorefiles;
   
     StoreFileList(ImmutableList<HStoreFile> storefiles, 
ImmutableList<HStoreFile> liveStorefiles) {
       this.storefiles = storefiles;
       this.liveStorefiles = liveStorefiles;
     }
   }
   
   private static final StoreFileList EMPTY_STOREFILE_LIST = new 
StoreFileList(ImmutableList.of(), null);
   
   private volatile StoreFileList storefiles = EMPTY_STOREFILE_LIST;
   ```



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

Reply via email to