@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.
|
acquire, acquire, release, size
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>
Copyright © 2023. All Rights Reserved.