@ThreadSafe public final class KeyValueWorkerClient extends AbstractClient
KeyValueWorkerClientService.Client
is not thread safe, this class
has to guarantee thread safety.AbstractClient.RpcCallable<V>
mAddress, mClosed, mConnected, mProtocol, mServiceVersion
Constructor and Description |
---|
KeyValueWorkerClient(WorkerNetAddress workerNetAddress)
Creates a
KeyValueWorkerClient . |
Modifier and Type | Method and Description |
---|---|
protected void |
afterConnect()
This method is called after the connection is made to the remote.
|
ByteBuffer |
get(long blockId,
ByteBuffer key)
Gets the value of a given
key from a specific key-value block. |
protected AlluxioService.Client |
getClient() |
List<ByteBuffer> |
getNextKeys(long blockId,
ByteBuffer key,
int numKeys)
Gets a batch of keys next to the current key in the partition.
|
protected String |
getServiceName() |
protected long |
getServiceVersion() |
int |
getSize(long blockId) |
afterDisconnect, beforeDisconnect, checkVersion, close, connect, disconnect, getAddress, isConnected, retryRPC, retryRPC
public KeyValueWorkerClient(WorkerNetAddress workerNetAddress)
KeyValueWorkerClient
.workerNetAddress
- location of the worker to connect toprotected AlluxioService.Client getClient()
getClient
in class AbstractClient
protected String getServiceName()
getServiceName
in class AbstractClient
protected long getServiceVersion()
getServiceVersion
in class AbstractClient
protected void afterConnect() throws IOException
AbstractClient
afterConnect
in class AbstractClient
IOException
public ByteBuffer get(long blockId, ByteBuffer key) throws IOException, AlluxioException
key
from a specific key-value block.blockId
- The id of the blockkey
- the key to get the value forIOException
AlluxioException
public List<ByteBuffer> getNextKeys(long blockId, ByteBuffer key, int numKeys) throws IOException, AlluxioException
If current key is null, it means get the initial batch of keys. If there are no more next keys, an empty list is returned.
blockId
- the id of the partitionkey
- the current keynumKeys
- maximum number of next keys to fetchIOException
AlluxioException
public int getSize(long blockId) throws IOException, AlluxioException
blockId
- the id of the partitionIOException
AlluxioException
Copyright © 2023. All Rights Reserved.