public class DefaultBlockWorkerClient extends Object implements BlockWorkerClient
BlockWorkerClient
.BlockWorkerClient.Factory
Constructor and Description |
---|
DefaultBlockWorkerClient(UserState userState,
GrpcServerAddress address,
AlluxioConfiguration alluxioConf)
Creates a client instance for communicating with block worker.
|
Modifier and Type | Method and Description |
---|---|
void |
cache(CacheRequest request)
Caches a block.
|
ClearMetricsResponse |
clearMetrics(ClearMetricsRequest request)
Clear the worker metrics.
|
void |
close() |
io.grpc.stub.StreamObserver<CreateLocalBlockRequest> |
createLocalBlock(io.grpc.stub.StreamObserver<CreateLocalBlockResponse> responseObserver)
Creates a local block on the worker.
|
void |
freeWorker()
Free this worker.
|
boolean |
isHealthy() |
boolean |
isShutdown() |
com.google.common.util.concurrent.ListenableFuture<LoadResponse> |
load(LoadRequest request)
load blocks into alluxio.
|
MoveBlockResponse |
moveBlock(MoveBlockRequest request)
Move a block from worker.
|
io.grpc.stub.StreamObserver<OpenLocalBlockRequest> |
openLocalBlock(io.grpc.stub.StreamObserver<OpenLocalBlockResponse> responseObserver)
Opens a local block.
|
io.grpc.stub.StreamObserver<ReadRequest> |
readBlock(io.grpc.stub.StreamObserver<ReadResponse> responseObserver)
Reads a block from the worker.
|
RemoveBlockResponse |
removeBlock(RemoveBlockRequest request)
Removes a block from worker.
|
io.grpc.stub.StreamObserver<WriteRequest> |
writeBlock(io.grpc.stub.StreamObserver<WriteResponse> responseObserver)
Writes a block to the worker asynchronously.
|
public DefaultBlockWorkerClient(UserState userState, GrpcServerAddress address, AlluxioConfiguration alluxioConf) throws IOException
userState
- the user stateaddress
- the address of the workeralluxioConf
- Alluxio configurationIOException
public boolean isShutdown()
isShutdown
in interface BlockWorkerClient
public boolean isHealthy()
isHealthy
in interface BlockWorkerClient
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public io.grpc.stub.StreamObserver<WriteRequest> writeBlock(io.grpc.stub.StreamObserver<WriteResponse> responseObserver)
BlockWorkerClient
writeBlock
in interface BlockWorkerClient
responseObserver
- the stream observer for the server responsepublic io.grpc.stub.StreamObserver<ReadRequest> readBlock(io.grpc.stub.StreamObserver<ReadResponse> responseObserver)
BlockWorkerClient
readBlock
in interface BlockWorkerClient
responseObserver
- the stream observer for the server responsepublic io.grpc.stub.StreamObserver<CreateLocalBlockRequest> createLocalBlock(io.grpc.stub.StreamObserver<CreateLocalBlockResponse> responseObserver)
BlockWorkerClient
createLocalBlock
in interface BlockWorkerClient
responseObserver
- the stream observer for the server responsepublic io.grpc.stub.StreamObserver<OpenLocalBlockRequest> openLocalBlock(io.grpc.stub.StreamObserver<OpenLocalBlockResponse> responseObserver)
BlockWorkerClient
openLocalBlock
in interface BlockWorkerClient
responseObserver
- the stream observer for the server responsepublic RemoveBlockResponse removeBlock(RemoveBlockRequest request)
BlockWorkerClient
removeBlock
in interface BlockWorkerClient
request
- the remove block requestpublic MoveBlockResponse moveBlock(MoveBlockRequest request)
BlockWorkerClient
moveBlock
in interface BlockWorkerClient
request
- the remove block requestpublic ClearMetricsResponse clearMetrics(ClearMetricsRequest request)
BlockWorkerClient
clearMetrics
in interface BlockWorkerClient
request
- the request to clear metricspublic void cache(CacheRequest request)
BlockWorkerClient
cache
in interface BlockWorkerClient
request
- the cache requestpublic void freeWorker()
BlockWorkerClient
freeWorker
in interface BlockWorkerClient
public com.google.common.util.concurrent.ListenableFuture<LoadResponse> load(LoadRequest request)
BlockWorkerClient
load
in interface BlockWorkerClient
request
- the cache requestCopyright © 2023. All Rights Reserved.