HTHou commented on code in PR #1577:
URL: https://github.com/apache/ratis/pull/1577#discussion_r3953615062
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java:
##########
@@ -163,14 +166,21 @@ synchronized int process(Event event) {
private final boolean useSeparateHBChannel;
private final GrpcServerMetrics grpcServerMetrics;
+ private final GrpcLogAppenderListener listener;
private final AutoCloseableReadWriteLock lock;
private final StackTraceElement caller;
private final RetryPolicy errorRetryWaitPolicy;
private final ReplyState replyState = new ReplyState();
public GrpcLogAppender(RaftServer.Division server, LeaderState leaderState,
FollowerInfo f) {
+ this(server, leaderState, f, null);
+ }
Review Comment:
Removed the unused three-argument constructor in 80b96f6d6.
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/GrpcFactory.java:
##########
@@ -127,7 +131,15 @@ public SupportedRpcType getRpcType() {
@Override
public LogAppender newLogAppender(RaftServer.Division server, LeaderState
state, FollowerInfo f) {
- return new GrpcLogAppender(server, state, f);
+ GrpcLogAppenderListener listener = null;
+ if (logAppenderListenerFactory != null) {
+ try {
+ listener = logAppenderListenerFactory.create(server.getMemberId(),
f.getPeer());
+ } catch (Throwable t) {
+ LOG.warn("Failed to create gRPC log appender listener", t);
Review Comment:
Updated in 80b96f6d6: the warning now includes the source group member and
destination peer IDs.
--
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]