keith-turner commented on code in PR #4740:
URL: https://github.com/apache/accumulo/pull/4740#discussion_r1676158782


##########
server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java:
##########
@@ -750,6 +744,7 @@ public void run() {
         JOB_HOLDER.set(job, compactionThread, fcr.getFileCompactor());
 
         try {
+          isIdle.set(false); // Set the state to busy just before the 
compaction starts

Review Comment:
   ```suggestion
            idleProcessCheck(()->false); // Set the state to busy just before 
the compaction starts
   ```



##########
server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java:
##########
@@ -702,16 +701,11 @@ public void run() {
     try {
 
       final AtomicReference<Throwable> err = new AtomicReference<>();
-      final AtomicLong timeSinceLastCompletion = new AtomicLong(0L);
+      final AtomicBoolean isIdle = new AtomicBoolean(true);
 
       while (!shutdown) {
 
-        idleProcessCheck(() -> {
-          return timeSinceLastCompletion.get() == 0
-              /* Never started a compaction */ || 
(timeSinceLastCompletion.get() > 0
-                  && (System.nanoTime() - timeSinceLastCompletion.get())
-                      > idleReportingPeriodNanos);
-        });
+        idleProcessCheck(isIdle::get);

Review Comment:
   ```suggestion
           idleProcessCheck(()->true);
   ```



##########
server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java:
##########
@@ -702,16 +701,11 @@ public void run() {
     try {
 
       final AtomicReference<Throwable> err = new AtomicReference<>();
-      final AtomicLong timeSinceLastCompletion = new AtomicLong(0L);
+      final AtomicBoolean isIdle = new AtomicBoolean(true);

Review Comment:
   ```suggestion
   ```



##########
server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java:
##########
@@ -861,7 +856,7 @@ public void run() {
           }
         } finally {
           currentCompactionId.set(null);
-          timeSinceLastCompletion.set(System.nanoTime());
+          isIdle.set(true); // Set the state to idle after the compaction is 
done

Review Comment:
   ```suggestion
           idleProcessCheck(()->true);  // Set the state to idle after the 
compaction is done
   ```



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