Ring-k commented on a change in pull request #1582:
URL: https://github.com/apache/incubator-iotdb/pull/1582#discussion_r463416875



##########
File path: 
cluster/src/main/java/org/apache/iotdb/cluster/log/manage/RaftLogManager.java
##########
@@ -100,6 +100,16 @@ public RaftLogManager(StableEntryManager 
stableEntryManager, LogApplier applier,
         .scheduleAtFixedRate(this::checkDeleteLog, 
logDeleteCheckIntervalSecond,
             logDeleteCheckIntervalSecond,
             TimeUnit.SECONDS);
+
+    /**
+     * flush log to file periodically
+     */
+    int logFlushTimeIntervalMS = ClusterDescriptor.getInstance().getConfig()
+        .getForceRaftLogPeriodInMS();
+    if 
(ClusterDescriptor.getInstance().getConfig().isEnableRaftLogPersistence()) {
+      executorService.scheduleAtFixedRate(this::flushLogPeriodically, 
logFlushTimeIntervalMS,
+          logFlushTimeIntervalMS, TimeUnit.MILLISECONDS);

Review comment:
       Thanks for your advice. I will use a new executor service for raft log 
writing.




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