
alluxio.client.block.stream.BlockWorkerClient Maven / Gradle / Ivy
/*
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
* (the "License"). You may not use this work except in alluxio.shaded.client.com.liance with the License, which is
* available at www.apache.alluxio.shaded.client.org.licenses/LICENSE-2.0
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied, as more fully set forth in the License.
*
* See the NOTICE file distributed with this work for information regarding copyright ownership.
*/
package alluxio.client.block.stream;
import alluxio.conf.AlluxioConfiguration;
import alluxio.grpc.CacheDataRequest;
import alluxio.grpc.CacheDataResponse;
import alluxio.grpc.CacheRequest;
import alluxio.grpc.ClearMetricsRequest;
import alluxio.grpc.ClearMetricsResponse;
import alluxio.grpc.CompleteFilePRequest;
import alluxio.grpc.CompleteFilePResponse;
import alluxio.grpc.CopyRequest;
import alluxio.grpc.CopyResponse;
import alluxio.grpc.CreateDirectoryPRequest;
import alluxio.grpc.CreateDirectoryPResponse;
import alluxio.grpc.CreateFilePRequest;
import alluxio.grpc.CreateFilePResponse;
import alluxio.grpc.DeletePRequest;
import alluxio.grpc.DeletePResponse;
import alluxio.grpc.ExistsPRequest;
import alluxio.grpc.ExistsPResponse;
import alluxio.grpc.GetStatusPRequest;
import alluxio.grpc.GetStatusPResponse;
import alluxio.grpc.GrpcServerAddress;
import alluxio.grpc.ListStatusPRequest;
import alluxio.grpc.ListStatusPResponse;
import alluxio.grpc.LoadFileRequest;
import alluxio.grpc.LoadFileResponse;
import alluxio.grpc.LoadRequest;
import alluxio.grpc.LoadResponse;
import alluxio.grpc.MoveBlockRequest;
import alluxio.grpc.MoveBlockResponse;
import alluxio.grpc.MoveRequest;
import alluxio.grpc.MoveResponse;
import alluxio.grpc.ReadRequest;
import alluxio.grpc.ReadResponse;
import alluxio.grpc.RemoveBlockRequest;
import alluxio.grpc.RemoveBlockResponse;
import alluxio.grpc.RenamePRequest;
import alluxio.grpc.RenamePResponse;
import alluxio.grpc.SetAttributePRequest;
import alluxio.grpc.SetAttributePResponse;
import alluxio.grpc.WriteRequest;
import alluxio.grpc.WriteResponse;
import alluxio.security.user.UserState;
import alluxio.shaded.client.com.google.alluxio.shaded.client.com.on.util.concurrent.ListenableFuture;
import alluxio.shaded.client.io.grpc.StatusRuntimeException;
import alluxio.shaded.client.io.grpc.stub.StreamObserver;
import java.alluxio.shaded.client.io.Closeable;
import java.alluxio.shaded.client.io.IOException;
import java.util.Iterator;
/**
* gRPC client for worker alluxio.shaded.client.com.unication.
*/
public interface BlockWorkerClient extends Closeable {
/**
* Factory for block worker client.
*/
class Factory {
/**
* Creates a new block worker client.
*
* @param userState the user subject
* @param address the address of the worker
* @param alluxioConf Alluxio configuration
* @return a new {@link BlockWorkerClient}
*/
public static BlockWorkerClient create(UserState userState, GrpcServerAddress address,
AlluxioConfiguration alluxioConf)
throws IOException {
return new DefaultBlockWorkerClient(userState, address, alluxioConf);
}
}
/**
* @return whether the client is shutdown
*/
boolean isShutdown();
/**
* @return whether the client is healthy
*/
boolean isHealthy();
/**
* Writes a block to the worker asynchronously. The caller should pass in a response observer
* for receiving server responses and handling errors.
*
* @param responseObserver the stream observer for the server response
* @return the stream observer for the client request
*/
StreamObserver writeBlock(StreamObserver responseObserver);
/**
* Reads a block from the worker. When client is done with the file, it should close the stream
* using the gRPC context.
*
* @param responseObserver the stream observer for the server response
* @return the stream observer for the client request
*/
StreamObserver readBlock(StreamObserver responseObserver);
/**
* Reads a block with getting actual data.
*
* @param request the read request
* @return the stream observer for the client request
*/
ListenableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy