public class DefaultBlockWorkerClient extends Object implements BlockWorkerClient
BlockWorkerClient
.BlockWorkerClient.Factory
Constructor and Description |
---|
DefaultBlockWorkerClient(Subject subject,
GrpcServerAddress address,
AlluxioConfiguration alluxioConf,
io.netty.channel.EventLoopGroup workerGroup)
Creates a client instance for communicating with block worker.
|
Modifier and Type | Method and Description |
---|---|
void |
asyncCache(AsyncCacheRequest request)
Caches a block asynchronously.
|
void |
close() |
io.grpc.stub.StreamObserver<CreateLocalBlockRequest> |
createLocalBlock(io.grpc.stub.StreamObserver<CreateLocalBlockResponse> responseObserver)
Creates a local block on the worker.
|
boolean |
isHealthy() |
boolean |
isShutdown() |
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(Subject subject, GrpcServerAddress address, AlluxioConfiguration alluxioConf, io.netty.channel.EventLoopGroup workerGroup) throws IOException
subject
- the user subject, can be null if the user is not availableaddress
- the address of the workeralluxioConf
- Alluxio configurationworkerGroup
- The netty EventLoopGroup
the channels are will utilizeIOException
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 void asyncCache(AsyncCacheRequest request)
BlockWorkerClient
asyncCache
in interface BlockWorkerClient
request
- the async cache requestCopyright © 2023. All Rights Reserved.