@ThreadSafe public final class BlockMasterClientPool extends DynamicResourcePool<BlockMasterClient>
ResourcePool.acquire()
, ResourcePool.release(Object)
must be called when the
thread is done using the client.DynamicResourcePool.Options, DynamicResourcePool.ResourceInternal<R>, DynamicResourcePool.SelectionPolicy
mClock, mResources, mSelectionPolicy
Constructor and Description |
---|
BlockMasterClientPool(MasterClientContext ctx)
Creates a new block master client pool.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeResource(BlockMasterClient client)
Closes the resource.
|
protected BlockMasterClient |
createNewResource()
Creates a new resource.
|
protected com.codahale.metrics.Counter |
getMetricCounter() |
protected boolean |
isHealthy(BlockMasterClient client)
Checks whether a resource is healthy or not.
|
protected boolean |
shouldGc(DynamicResourcePool.ResourceInternal<BlockMasterClient> clientResourceInternal) |
acquire, acquire, close, release, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquireCloseable, acquireCloseable
public BlockMasterClientPool(MasterClientContext ctx)
ctx
- the information required for connecting to Alluxioprotected void closeResource(BlockMasterClient client)
DynamicResourcePool
closeResource
in class DynamicResourcePool<BlockMasterClient>
client
- the resource to closeprotected BlockMasterClient createNewResource()
DynamicResourcePool
createNewResource
in class DynamicResourcePool<BlockMasterClient>
protected boolean isHealthy(BlockMasterClient client)
DynamicResourcePool
isHealthy
in class DynamicResourcePool<BlockMasterClient>
client
- the resource to checkprotected com.codahale.metrics.Counter getMetricCounter()
getMetricCounter
in class DynamicResourcePool<BlockMasterClient>
protected boolean shouldGc(DynamicResourcePool.ResourceInternal<BlockMasterClient> clientResourceInternal)
shouldGc
in class DynamicResourcePool<BlockMasterClient>
clientResourceInternal
- the resource to checkCopyright © 2023. All Rights Reserved.