use of org.apache.ratis.protocol.exceptions.StreamException in project incubator-ratis by apache.
the class MessageStreamRequests method streamEndOfRequestAsync.
CompletableFuture<ByteString> streamEndOfRequestAsync(RaftClientRequest request) {
final MessageStreamRequestTypeProto stream = request.getType().getMessageStream();
Preconditions.assertTrue(stream.getEndOfRequest());
final ClientInvocationId key = ClientInvocationId.valueOf(request.getClientId(), stream.getStreamId());
final PendingStream pending = streams.remove(key);
if (pending == null) {
return JavaUtils.completeExceptionally(new StreamException(name + ": " + key + " not found"));
}
return pending.getBytes(stream.getMessageId(), request.getMessage());
}
Aggregations