szetszwo commented on code in PR #11356:
URL: https://github.com/apache/ozone/pull/11356#discussion_r4187129986
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java:
##########
@@ -740,6 +741,32 @@ void streamPutBlock(ContainerCommandRequestProto request)
throws IOException {
dispatchCommand(request, context);
}
+ /**
+ * Commit a PutBlock sent as a command in the middle of a data stream;
+ * see {@link StateMachine.DataStream#onCommand(ByteBuffer, long)}.
+ * The PutBlock is applied without a Raft log entry, so it has no log index
to use as bcsId.
+ *
+ * @return the serialized {@link ContainerCommandResponseProto},
+ * which is identical on all the peers of the pipeline.
+ */
+ ByteBuffer streamCommand(ByteBuffer command) throws IOException {
+ final ContainerCommandRequestProto request =
ContainerCommandRequestMessage.toProto(
+ ByteString.copyFrom(command), getGroupId());
Review Comment:
We may unsafeWrap(..) in streamCommand.
```java
ByteBuffer streamCommand(ByteBuffer command) throws IOException {
final ContainerCommandRequestProto request =
ContainerCommandRequestMessage.toProto(
UnsafeByteOperations.unsafeWrap(command), getGroupId());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]