@ThreadSafe public final class BlockWorkerClientPool extends DynamicResourcePool<BlockWorkerClient>
DynamicResourcePool.acquire()
, DynamicResourcePool.release(Object)
must be called
when the thread is done using the client.DynamicResourcePool.Options, DynamicResourcePool.ResourceInternal<R>
mClock
Constructor and Description |
---|
BlockWorkerClientPool(Subject subject,
GrpcServerAddress address,
int maxCapacity,
AlluxioConfiguration alluxioConf,
io.netty.channel.EventLoopGroup workerGroup)
Creates a new block master client pool.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeResource(BlockWorkerClient client)
Closes the resource.
|
protected BlockWorkerClient |
createNewResource()
Creates a new resource.
|
protected boolean |
isHealthy(BlockWorkerClient client)
Checks whether a client is healthy.
|
protected boolean |
shouldGc(DynamicResourcePool.ResourceInternal<BlockWorkerClient> clientResourceInternal) |
public BlockWorkerClientPool(Subject subject, GrpcServerAddress address, int maxCapacity, AlluxioConfiguration alluxioConf, io.netty.channel.EventLoopGroup workerGroup)
subject
- the parent subjectaddress
- address of the workermaxCapacity
- the maximum capacity of the poolalluxioConf
- Alluxio configurationworkerGroup
- netty event loop group to create clients with is above the minimum
capacity(1), it is closed and removed from the pool.protected void closeResource(BlockWorkerClient client) throws IOException
DynamicResourcePool
closeResource
in class DynamicResourcePool<BlockWorkerClient>
client
- the resource to closeIOException
protected BlockWorkerClient createNewResource() throws IOException
DynamicResourcePool
createNewResource
in class DynamicResourcePool<BlockWorkerClient>
IOException
protected boolean isHealthy(BlockWorkerClient client)
isHealthy
in class DynamicResourcePool<BlockWorkerClient>
client
- the client to checkprotected boolean shouldGc(DynamicResourcePool.ResourceInternal<BlockWorkerClient> clientResourceInternal)
shouldGc
in class DynamicResourcePool<BlockWorkerClient>
clientResourceInternal
- the resource to checkCopyright © 2023. All Rights Reserved.