szetszwo commented on a change in pull request #616:
URL: https://github.com/apache/ratis/pull/616#discussion_r820051767
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java
##########
@@ -217,8 +216,9 @@ synchronized void updateIndex(long i) {
final int bufferSize =
RaftServerConfigKeys.Log.writeBufferSize(properties).getSizeInt();
this.writeBuffer = ByteBuffer.allocateDirect(bufferSize);
- this.lastFlush = Timestamp.currentTime();
- this.flushIntervalMin =
RaftServerConfigKeys.Log.flushIntervalMin(properties);
+ this.flushExecutorWorkQueue = new ArrayBlockingQueue<>(1);
+ this.flushExecutor = new ThreadPoolExecutor(1, 1, 0L,
TimeUnit.MILLISECONDS,
Review comment:
Use a 60s keepAliveTime as below -- the zero keepAliveTime probably is
the reason that ExecutorService being slower than single Thread.
```
this.flushExecutor = new ThreadPoolExecutor(1, 1, 60L, TimeUnit.SECONDS,
this.flushExecutorWorkQueue, ConcurrentUtils.newThreadFactory(name +
"-flush"));
```
--
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]