public class DefaultBlockWorkerClient extends Object implements BlockWorkerClient
BlockWorkerClient
.Modifier and Type | Class and Description |
---|---|
static class |
DefaultBlockWorkerClient.NoDataReadStreamObserver
No data read stream observer.
|
BlockWorkerClient.Factory
Modifier | Constructor and Description |
---|---|
|
DefaultBlockWorkerClient(UserState userState,
GrpcServerAddress address,
AlluxioConfiguration alluxioConf)
Creates a client instance for communicating with block worker.
|
protected |
DefaultBlockWorkerClient(UserState userState,
GrpcServerAddress address,
AlluxioConfiguration alluxioConf,
GrpcChannel streamingChannel,
GrpcChannel rpcChannel) |
Modifier and Type | Method and Description |
---|---|
void |
cache(CacheRequest request)
Caches a block.
|
ClearMetricsResponse |
clearMetrics(ClearMetricsRequest request)
Clear the worker metrics.
|
void |
close() |
CompleteFilePResponse |
completeFile(CompleteFilePRequest request)
Complete a file when writing is done.
|
com.google.common.util.concurrent.ListenableFuture<CopyResponse> |
copy(CopyRequest request)
copy files from src to dst.
|
CreateDirectoryPResponse |
createDirectory(CreateDirectoryPRequest request)
Create a directory.
|
CreateFilePResponse |
createFile(CreateFilePRequest request)
Create file request from client to worker.
|
DeletePResponse |
delete(DeletePRequest request)
Delete a file from.
|
ExistsPResponse |
exists(ExistsPRequest request)
Check if a file or dir exists.
|
void |
freeWorker()
Free this worker.
|
GetStatusPResponse |
getStatus(GetStatusPRequest request)
get file status.
|
boolean |
isHealthy() |
boolean |
isShutdown() |
Iterator<ListStatusPResponse> |
listStatus(ListStatusPRequest request)
List status from Worker.
|
com.google.common.util.concurrent.ListenableFuture<LoadResponse> |
load(LoadRequest request)
load blocks into alluxio.
|
com.google.common.util.concurrent.ListenableFuture<LoadFileResponse> |
loadFile(LoadFileRequest request)
load files.
|
com.google.common.util.concurrent.ListenableFuture<MoveResponse> |
move(MoveRequest request)
move files from src to dst.
|
MoveBlockResponse |
moveBlock(MoveBlockRequest request)
Move a block from worker.
|
io.grpc.stub.StreamObserver<ReadRequest> |
readBlock(io.grpc.stub.StreamObserver<ReadResponse> responseObserver)
Reads a block from the worker.
|
com.google.common.util.concurrent.ListenableFuture<Object> |
readBlockNoDataBack(ReadRequest request)
Reads a block with getting actual data.
|
RemoveBlockResponse |
removeBlock(RemoveBlockRequest request)
Removes a block from worker.
|
RenamePResponse |
rename(RenamePRequest request)
Rename the src to dst.
|
SetAttributePResponse |
setAttribute(SetAttributePRequest request)
SetAttribute for a file or dir.
|
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
protected DefaultBlockWorkerClient(UserState userState, GrpcServerAddress address, AlluxioConfiguration alluxioConf, GrpcChannel streamingChannel, GrpcChannel rpcChannel) throws IOException
IOException
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 com.google.common.util.concurrent.ListenableFuture<Object> readBlockNoDataBack(ReadRequest request)
BlockWorkerClient
readBlockNoDataBack
in interface BlockWorkerClient
request
- the read requestpublic 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 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 requestpublic com.google.common.util.concurrent.ListenableFuture<LoadFileResponse> loadFile(LoadFileRequest request)
BlockWorkerClient
loadFile
in interface BlockWorkerClient
public GetStatusPResponse getStatus(GetStatusPRequest request)
BlockWorkerClient
getStatus
in interface BlockWorkerClient
public Iterator<ListStatusPResponse> listStatus(ListStatusPRequest request)
BlockWorkerClient
listStatus
in interface BlockWorkerClient
public com.google.common.util.concurrent.ListenableFuture<CopyResponse> copy(CopyRequest request)
BlockWorkerClient
copy
in interface BlockWorkerClient
request
- the copy requestpublic com.google.common.util.concurrent.ListenableFuture<MoveResponse> move(MoveRequest request)
BlockWorkerClient
move
in interface BlockWorkerClient
request
- the move requestpublic CreateFilePResponse createFile(CreateFilePRequest request)
BlockWorkerClient
createFile
in interface BlockWorkerClient
request
- the request to create a filepublic CompleteFilePResponse completeFile(CompleteFilePRequest request)
BlockWorkerClient
completeFile
in interface BlockWorkerClient
request
- the request to complete a filepublic DeletePResponse delete(DeletePRequest request)
BlockWorkerClient
delete
in interface BlockWorkerClient
request
- the request to delete a filepublic RenamePResponse rename(RenamePRequest request)
BlockWorkerClient
rename
in interface BlockWorkerClient
request
- the request to do renamepublic CreateDirectoryPResponse createDirectory(CreateDirectoryPRequest request)
BlockWorkerClient
createDirectory
in interface BlockWorkerClient
request
- the request to create a dirpublic ExistsPResponse exists(ExistsPRequest request)
BlockWorkerClient
exists
in interface BlockWorkerClient
request
- the request to do the cechkingpublic SetAttributePResponse setAttribute(SetAttributePRequest request)
BlockWorkerClient
setAttribute
in interface BlockWorkerClient
request
- the request to do the operationCopyright © 2023. All Rights Reserved.