public enum BlockStoreContext extends Enum<BlockStoreContext>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
WorkerClient |
acquireLocalWorkerClient()
Obtains a worker client on the local worker in the system.
|
BlockMasterClient |
acquireMasterClient()
Acquires a block master client from the block master client pool.
|
WorkerClient |
acquireWorkerClient()
Obtains a worker client to a worker in the system.
|
WorkerClient |
acquireWorkerClient(String hostname)
Obtains a worker client to the worker with the given hostname in the system.
|
boolean |
hasLocalWorker()
Determines if a local worker was available during the initialization of the client.
|
void |
releaseMasterClient(BlockMasterClient masterClient)
Releases a block master client into the block master client pool.
|
void |
releaseWorkerClient(WorkerClient workerClient)
Releases the WorkerClient back to the client pool, or destroys it if it was a remote client.
|
void |
reset()
Re-initializes the Block Store context.
|
static BlockStoreContext |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BlockStoreContext[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BlockStoreContext INSTANCE
public static BlockStoreContext[] values()
for (BlockStoreContext c : BlockStoreContext.values()) System.out.println(c);
public static BlockStoreContext valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic BlockMasterClient acquireMasterClient()
public void releaseMasterClient(BlockMasterClient masterClient)
masterClient
- a block master client to releasepublic WorkerClient acquireWorkerClient()
WorkerClient.isLocal()
to verify if the client
is local before assuming so.public WorkerClient acquireWorkerClient(String hostname) throws IOException
hostname
- the hostname of the worker to get a client to, empty String indicates all
workers are eligibleIOException
- if no Tachyon worker is available for the given hostnamepublic WorkerClient acquireLocalWorkerClient()
public void releaseWorkerClient(WorkerClient workerClient)
workerClient
- the worker client to release, the client should not be accessed after this
method is calledpublic boolean hasLocalWorker()
public void reset()
ClientContext
.Copyright © 2015. All Rights Reserved.