Package alluxio.grpc

Class GrpcChannelPool


  • @ThreadSafe
    public class GrpcChannelPool
    extends java.lang.Object
    Used to provide gRPC level connection management and pooling facilities. This class is used internally by GrpcChannelBuilder and GrpcChannel.
    • Method Detail

      • acquireChannel

        public GrpcChannel acquireChannel​(GrpcNetworkGroup networkGroup,
                                          GrpcServerAddress serverAddress,
                                          AlluxioConfiguration conf,
                                          boolean alwaysEnableTLS)
        Acquires and increases the ref-count for the ManagedChannel.
        Parameters:
        networkGroup - network group
        serverAddress - server address
        conf - the Alluxio configuration
        alwaysEnableTLS - whether to always enable TLS
        Returns:
        a GrpcChannel
      • releaseConnection

        public void releaseConnection​(GrpcChannelKey channelKey)
        Decreases the ref-count of the ManagedChannel for the given address. It shuts down the underlying channel if reference count reaches zero.
        Parameters:
        channelKey - the connection key