sashapolo commented on code in PR #7880:
URL: https://github.com/apache/ignite-3/pull/7880#discussion_r3020217377


##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/RaftLogGarbageCollector.java:
##########
@@ -71,11 +86,66 @@ class RaftLogGarbageCollector {
 
     private final IndexFileManager indexFileManager;
 
+    private final long softLimitBytes;
+
+    private final SegmentFileCompactionStrategy strategy;
+
+    private final FailureProcessor failureProcessor;
+
     private final AtomicLong logSizeBytes = new AtomicLong();
 
-    RaftLogGarbageCollector(Path segmentFilesDir, IndexFileManager 
indexFileManager) {
+    private final Thread gcThread;
+
+    RaftLogGarbageCollector(
+            String nodeName,
+            Path segmentFilesDir,
+            IndexFileManager indexFileManager,
+            long softLimitBytes,
+            SegmentFileCompactionStrategy strategy,
+            FailureProcessor failureProcessor
+    ) {
         this.segmentFilesDir = segmentFilesDir;
         this.indexFileManager = indexFileManager;
+        this.softLimitBytes = softLimitBytes;
+        this.strategy = strategy;
+        this.failureProcessor = failureProcessor;
+
+        gcThread = new IgniteThread(nodeName, "segstore-gc", new GcTask());
+    }
+
+    void start() throws IOException {
+        initLogSizeFromDisk();
+
+        gcThread.start();
+    }
+
+    void stop() {
+        gcThread.interrupt();

Review Comment:
   > Are you sure that you won't interrupt any file channel that's still in use?
   
   Could you please elaborate? Why is that a bad thing?



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