frostruan commented on a change in pull request #3261:
URL: https://github.com/apache/hbase/pull/3261#discussion_r631736048



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
##########
@@ -1953,6 +1954,24 @@ private void addToCompactingFiles(Collection<HStoreFile> 
filesToAdd) {
     Collections.sort(filesCompacting, 
storeEngine.getStoreFileManager().getStoreFileComparator());
   }
 
+  /**
+   * Remove the files from compacting files. This usually happens when we 
clear compaction queues.
+   */
+  void removeFromCompactingFiles(Collection<HStoreFile> filesToRemove) {
+    synchronized (filesCompacting) {
+      filesCompacting.removeAll(filesToRemove);
+      Collections.sort(filesCompacting, 
storeEngine.getStoreFileManager().getStoreFileComparator());
+    }

Review comment:
       I think we should always keep it sorted. some methods, like 
org.apache.hadoop.hbase.regionserver.compactions.SortedCompactionPolicy#getCurrentEligibleFiles(),
 may will not work if it is unsorted.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to