Skip to content

RATIS-2625. Streaming: support control plane in Data Stream - #1534

Open
amaliujia wants to merge 8 commits into
apache:masterfrom
amaliujia:control_api
Open

RATIS-2625. Streaming: support control plane in Data Stream#1534
amaliujia wants to merge 8 commits into
apache:masterfrom
amaliujia:control_api

Conversation

@amaliujia

@amaliujia amaliujia commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR is AI-assisted

Adds a first-class mid-stream command plane to Ratis data streams. Callers can send opaque command payloads during an active stream via DataStreamOutput.commandAsync(). The server delivers them to StateMachine.DataStream.onCommand() instead of writing bytes to the data channel. Commands are ordered with data writes, replicated to remote peers like STREAM_DATA, and do not advance the stream byte offset.

Example usage:

// Client
out.getHeaderFuture().join();
out.writeAsync(dataBuffer).join();
out.commandAsync(myCommandBytes).join();  // opaque payload
out.writeAsync(moreData, StandardWriteOption.CLOSE).join();

// State machine
@Override
public CompletableFuture<?> onCommand(ByteBuffer command, long streamOffset) {
  // parse command, e.g. force(), metadata update, etc.
  return CompletableFuture.completedFuture(null);
}

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2625

How was this patch tested?

Unit tests

@amaliujia
amaliujia marked this pull request as draft July 29, 2026 02:48
@amaliujia amaliujia changed the title update [In Progress] Control Plane in Data Stream API Jul 29, 2026
@amaliujia amaliujia changed the title [In Progress] Control Plane in Data Stream API RATIS-2625. Control Plane in Data Stream API Jul 30, 2026
@amaliujia amaliujia changed the title RATIS-2625. Control Plane in Data Stream API RATIS-2625. Streaming: support control plane in Data Stream Jul 30, 2026
@amaliujia
amaliujia marked this pull request as ready for review July 30, 2026 03:28
@amaliujia

Copy link
Copy Markdown
Contributor Author

@szetszwo this is the follow up for apache/ozone#10823 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant