private GrpcChannel buildChannel(Subject subject, SocketAddress address, GrpcManagedChannelPool.PoolingStrategy poolingStrategy, AlluxioConfiguration alluxioConf) throws UnauthenticatedException, UnavailableException { return GrpcChannelBuilder.newBuilder(address, alluxioConf).setSubject(subject) .setChannelType(NettyUtils .getClientChannelClass(!(address instanceof InetSocketAddress), alluxioConf)) .setPoolingStrategy(poolingStrategy) .setEventLoopGroup(WORKER_GROUP) .setKeepAliveTimeout(alluxioConf.getMs(PropertyKey.USER_NETWORK_KEEPALIVE_TIMEOUT_MS), TimeUnit.MILLISECONDS) .setMaxInboundMessageSize( (int) alluxioConf.getBytes(PropertyKey.USER_NETWORK_MAX_INBOUND_MESSAGE_SIZE)) .setFlowControlWindow( (int) alluxioConf.getBytes(PropertyKey.USER_NETWORK_FLOWCONTROL_WINDOW)) .build(); } }