adoroszlai commented on a change in pull request #401:
URL: https://github.com/apache/incubator-ratis/pull/401#discussion_r562441658
##########
File path:
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcService.java
##########
@@ -118,23 +144,76 @@ private GrpcService(RaftServer raftServer,
Supplier<RaftPeerId> idSupplier, int
this.clientProtocolService = new GrpcClientProtocolService(idSupplier,
raftServer);
+ final int port = serverConfig.getPort();
this.serverInterceptor = new MetricServerInterceptor(
idSupplier,
JavaUtils.getClassSimpleName(getClass()) + "_" + port
);
- NettyServerBuilder nettyServerBuilder = NettyServerBuilder.forPort(port)
+ final boolean separateAdminServer =
!serverConfig.equals(adminServerConfig);
+ final boolean separateClientServer =
!serverConfig.equals(clientServerConfig);
+
+ final NettyServerBuilder serverBuilder =
+ startBuildingNettyServer(serverConfig, grpcMessageSizeMax,
flowControlWindow);
+ serverBuilder.addService(ServerInterceptors.intercept(
+ new GrpcServerProtocolService(idSupplier, raftServer),
serverInterceptor));
+ if (!separateAdminServer) {
+ addAdminService(raftServer, serverBuilder);
Review comment:
I don't think we can move it after `serverBuilder.build()` call.
----------------------------------------------------------------
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:
[email protected]