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



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java
##########
@@ -794,13 +795,23 @@ void shutdownLongCompactions(){
   }
 
   public void clearLongCompactionsQueue() {
+    removeFromFilesCompacting(longCompactions);
     longCompactions.getQueue().clear();
   }
 
   public void clearShortCompactionsQueue() {
+    removeFromFilesCompacting(shortCompactions);
     shortCompactions.getQueue().clear();
   }
 
+  private void removeFromFilesCompacting(ThreadPoolExecutor compactor) {
+    for (Runnable runnable : compactor.getQueue()) {
+      CompactionRunner runner = (CompactionRunner) runnable;

Review comment:
       For sure it will always be a CompactionRunner ? Should you check for it?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
##########
@@ -1953,6 +1953,22 @@ 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.
+   */
+  public void removeFromCompactingFiles(Collection<HStoreFile> filesToRemove) {
+    synchronized (filesCompacting) {
+      filesCompacting.removeAll(filesToRemove);
+      Collections.sort(filesCompacting, 
storeEngine.getStoreFileManager().getStoreFileComparator());
+    }
+  }
+
+  public List<HStoreFile> getFilesCompacting() {

Review comment:
       This is for test only?
   
   See 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
 for how methods like this are marked with a @RestrictedApi annotation.
   
   It looks like this method and the one above it can be package-private rather 
than public?




-- 
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:
[email protected]


Reply via email to