ivandika3 commented on code in PR #1362:
URL: https://github.com/apache/ratis/pull/1362#discussion_r2868964359
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -353,10 +370,23 @@ boolean isApplied() {
private final PendingStepDown pendingStepDown;
private final ReadIndexHeartbeats readIndexHeartbeats;
- private final boolean readIndexAppliedIndexEnabled;
+ private final RaftServerConfigKeys.Read.ReadIndex.Type readIndexType;
+ private final Supplier<Long> readIndexSupplier;
+ private final MemoizedSupplier<String> readIndexLogPrefixSupplier;
private final boolean leaderHeartbeatCheckEnabled;
private final LeaderLease lease;
+ /** The interval at which held write replies are flushed. */
+ private final TimeDuration repliedIndexBatchInterval;
+ /** The highest log index for which a write reply has been flushed (sent to
the client). */
+ private final AtomicLong repliedIndex;
+ /** Guards {@link #heldReplies}. */
+ private final Object heldRepliesLock = new Object();
+ /** Buffer holding write replies waiting to be flushed. Guarded by {@link
#heldRepliesLock}. */
+ private List<HeldReply> heldReplies = new ArrayList<>();
+ /** Daemon thread that periodically flushes held replies. */
+ private volatile Daemon replyFlusher;
Review Comment:
Thanks for the idea and the patch. Updated based on the patch.
--
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]