swamirishi commented on code in PR #5145:
URL: https://github.com/apache/ozone/pull/5145#discussion_r1283571620


##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -229,21 +227,22 @@ public class RocksDBCheckpointDiffer implements 
AutoCloseable,
             TimeUnit.MILLISECONDS);
 
     if (pruneCompactionDagDaemonRunIntervalInMs > 0) {
-      this.executor = Executors.newSingleThreadScheduledExecutor();
-      this.executor.scheduleWithFixedDelay(
+      this.scheduler = new Scheduler("CompactionDagPruningService",

Review Comment:
   BTW had a doubt can't we just have this schedule in a run method or 
something and still keep this object singleton? 



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java:
##########
@@ -98,10 +97,12 @@ public RDBStore(File dbFile, ManagedDBOptions dbOptions,
 
     try {
       if (enableCompactionDag) {
-        rocksDBCheckpointDiffer = RocksDBCheckpointDifferHolder.getInstance(
+        rocksDBCheckpointDiffer = new RocksDBCheckpointDiffer(

Review Comment:
   RocksDBCheckpointDifferHolder can be removed



##########
hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java:
##########
@@ -229,21 +227,22 @@ public class RocksDBCheckpointDiffer implements 
AutoCloseable,
             TimeUnit.MILLISECONDS);
 
     if (pruneCompactionDagDaemonRunIntervalInMs > 0) {
-      this.executor = Executors.newSingleThreadScheduledExecutor();
-      this.executor.scheduleWithFixedDelay(
+      this.scheduler = new Scheduler("CompactionDagPruningService",

Review Comment:
   Any particular reason why we need to move away from singleton here?



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