public interface MessageStreamApi
Message(s) asynchronously to the leader.
Once a stream has been closed or has been signaled an end-of-request,
the leader creates a raft log entry for the request
and then replicates the log entry to all the followers.
Note that this API is similar to AsyncApi.send(Message)
except that MessageStreamApi divides a (large) message into multiple (small) sub-messages in the stream
but AsyncApi.send(Message) sends the entire message in a single RPC.
For sending large messages,
MessageStreamApi is more efficient than AsyncApi.send(Message)}.
Note also that this API is different from DataStreamApi in the sense that
this API streams messages only to the leader
but DataStreamApi streams data to all the servers in the RaftGroup.| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 限定符和类型 | 方法和说明 |
|---|---|
MessageOutputStream |
stream()
Create a stream to send a large message.
|
CompletableFuture<RaftClientReply> |
streamAsync(Message message)
Send the given message using a stream with submessage size specified in conf.
|
CompletableFuture<RaftClientReply> |
streamAsync(Message message,
SizeInBytes submessageSize)
Send the given (large) message using a stream with the submessage size.
|
MessageOutputStream stream()
CompletableFuture<RaftClientReply> streamAsync(Message message, SizeInBytes submessageSize)
CompletableFuture<RaftClientReply> streamAsync(Message message)
Copyright © 2017–2025 The Apache Software Foundation. All rights reserved.