szetszwo commented on code in PR #1679:
URL: https://github.com/apache/ratis/pull/1679#discussion_r4484460129
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/GrpcConfigKeys.java:
##########
@@ -362,6 +362,21 @@ static void setStubPoolSize(RaftProperties properties, int
size) {
setInt(properties::setInt, STUB_POOL_SIZE_KEY, size);
}
+ /**
+ * The number of connections to each peer used for appendEntries. The
groups shared with a peer are spread over
+ * them, each group always using the same one, so that the replication
between two servers is not limited to one
+ * connection and so one event-loop thread at each end. Heartbeats keep
their own channel.
+ */
+ String LOG_APPENDER_CONNECTIONS_KEY = PREFIX + ".log-appender.connections";
Review Comment:
We already has `raft.grpc.server.log.appender.listener.factory`. This new
conf should use the same `raft.grpc.server.log.appender` prefix.
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -422,6 +425,13 @@ void onCompleted() {
}
}
+ @VisibleForTesting
+ int getAppendEntriesIndex() {
Review Comment:
It is better to call it getAppendEntriesIndexForTesting instead of using
VisibleForTesting.
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -163,6 +164,8 @@ synchronized int process(Event event) {
private final TimeoutExecutor scheduler = TimeoutExecutor.getInstance();
@SuppressWarnings({"squid:S3077"}) // Suppress volatile for generic type
private volatile StreamObservers appendLogRequestObserver;
+ // the appendEntries channel of this appender, taken when it creates its
first stream; guarded by the write lock
+ private int appendEntriesIndex = -1;
Review Comment:
- Why appendEntriesIndex is in GrpcLogAppender but not together with the
lists in GrpcServerProtocolClient?
- Also, it is really a bad name. It confuses with the log index in
appendEntries.
--
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]