ReqT - type of the requestResT - type of the response@NotThreadSafe public class GrpcDataMessageBlockingStream<ReqT,ResT> extends GrpcBlockingStream<ReqT,ResT>
| Constructor and Description |
|---|
GrpcDataMessageBlockingStream(java.util.function.Function<io.grpc.stub.StreamObserver<ResT>,io.grpc.stub.StreamObserver<ReqT>> rpcFunc,
int bufferSize,
String description,
alluxio.grpc.DataMessageMarshaller<ReqT> requestMarshaller,
alluxio.grpc.DataMessageMarshaller<ResT> responseMarshaller) |
| Modifier and Type | Method and Description |
|---|---|
ResT |
receive(long timeoutMs)
Receives a response from the server.
|
alluxio.grpc.DataMessage<ResT,alluxio.network.protocol.databuffer.DataBuffer> |
receiveDataMessage(long timeoutMs)
Receives a response with data buffer from the server.
|
void |
sendDataMessage(alluxio.grpc.DataMessage<ReqT,alluxio.network.protocol.databuffer.DataBuffer> message,
long timeoutMs)
Sends a request.
|
void |
waitForComplete(long timeoutMs)
Wait for server to complete the inbound stream.
|
cancel, close, isCanceled, isClosed, isClosedFromRemote, isOpen, send, sendpublic GrpcDataMessageBlockingStream(java.util.function.Function<io.grpc.stub.StreamObserver<ResT>,io.grpc.stub.StreamObserver<ReqT>> rpcFunc, int bufferSize, String description, alluxio.grpc.DataMessageMarshaller<ReqT> requestMarshaller, alluxio.grpc.DataMessageMarshaller<ResT> responseMarshaller)
rpcFunc - the gRPC bi-directional stream stub functionbufferSize - maximum number of incoming messages the buffer can holddescription - description of this streamrequestMarshaller - the marshaller for the requestresponseMarshaller - the marshaller for the responsepublic ResT receive(long timeoutMs) throws IOException
GrpcBlockingStreamreceive in class GrpcBlockingStream<ReqT,ResT>timeoutMs - maximum time to wait before giving up and throwing
a DeadlineExceededExceptionIOException - if any error occurspublic alluxio.grpc.DataMessage<ResT,alluxio.network.protocol.databuffer.DataBuffer> receiveDataMessage(long timeoutMs) throws IOException
timeoutMs - maximum time to wait before giving up and throwing
a DeadlineExceededExceptionIOException - if any error occurspublic void sendDataMessage(alluxio.grpc.DataMessage<ReqT,alluxio.network.protocol.databuffer.DataBuffer> message, long timeoutMs) throws IOException
message - the request message with attachedtimeoutMs - maximum wait time before throwing a DeadlineExceededExceptionIOException - if any error occurspublic void waitForComplete(long timeoutMs)
throws IOException
GrpcBlockingStreamwaitForComplete in class GrpcBlockingStream<ReqT,ResT>timeoutMs - maximum time to wait for server responseIOExceptionCopyright © 2024. All Rights Reserved.