@ThreadSafe public class BlockMasterClientPool extends ResourcePool<BlockMasterClient>
ResourcePool.acquire()
, ResourcePool.release(Object)
must be called when the
thread is done using the client.mCurrentCapacity, mMaxCapacity, mResources
Constructor and Description |
---|
BlockMasterClientPool()
Creates a new block master client pool.
|
BlockMasterClientPool(InetSocketAddress address)
Creates a new block master client pool.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the resource pool.
|
BlockMasterClient |
createNewResource()
Creates a new resource which will be added to the resource pool after the user is done using
it.
|
protected Queue<BlockMasterClient> |
getClientList() |
protected InetSocketAddress |
getMasterAddress() |
protected MasterClientContext |
getMasterContext() |
acquire, acquire, release, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquireCloseable, acquireCloseable
@Inject public BlockMasterClientPool()
public BlockMasterClientPool(@Nullable InetSocketAddress address)
address
- the block master addresspublic void close() throws IOException
ResourcePool
close
in interface Closeable
close
in interface AutoCloseable
close
in class ResourcePool<BlockMasterClient>
IOException
public BlockMasterClient createNewResource()
ResourcePool
createNewResource
in class ResourcePool<BlockMasterClient>
protected InetSocketAddress getMasterAddress()
protected MasterClientContext getMasterContext()
protected Queue<BlockMasterClient> getClientList()
Copyright © 2023. All Rights Reserved.