Package alluxio.grpc
Class GrpcChannelPool
- java.lang.Object
-
- alluxio.grpc.GrpcChannelPool
-
@ThreadSafe public class GrpcChannelPool extends java.lang.Object
Used to provide gRPC level connection management and pooling facilities. This class is used internally byGrpcChannelBuilder
andGrpcChannel
.
-
-
Field Summary
Fields Modifier and Type Field Description static GrpcChannelPool
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcChannel
acquireChannel(GrpcNetworkGroup networkGroup, GrpcServerAddress serverAddress, AlluxioConfiguration conf, boolean alwaysEnableTLS)
Acquires and increases the ref-count for theManagedChannel
.void
releaseConnection(GrpcChannelKey channelKey)
Decreases the ref-count of theManagedChannel
for the given address.
-
-
-
Field Detail
-
INSTANCE
public static final GrpcChannelPool INSTANCE
-
-
Method Detail
-
acquireChannel
public GrpcChannel acquireChannel(GrpcNetworkGroup networkGroup, GrpcServerAddress serverAddress, AlluxioConfiguration conf, boolean alwaysEnableTLS)
Acquires and increases the ref-count for theManagedChannel
.- Parameters:
networkGroup
- network groupserverAddress
- server addressconf
- the Alluxio configurationalwaysEnableTLS
- whether to always enable TLS- Returns:
- a
GrpcChannel
-
releaseConnection
public void releaseConnection(GrpcChannelKey channelKey)
Decreases the ref-count of theManagedChannel
for the given address. It shuts down the underlying channel if reference count reaches zero.- Parameters:
channelKey
- the connection key
-
-