peterxcli commented on code in PR #1481:
URL: https://github.com/apache/ratis/pull/1481#discussion_r3427308098
##########
ratis-common/src/main/java/org/apache/ratis/protocol/DataStreamReply.java:
##########
@@ -22,12 +22,23 @@
import java.util.Collection;
-public interface DataStreamReply extends DataStreamPacket {
+public interface DataStreamReply extends DataStreamPacket, AutoCloseable {
boolean isSuccess();
long getBytesWritten();
/** @return the commit information when the reply is created. */
Collection<CommitInfoProto> getCommitInfos();
-}
\ No newline at end of file
+
+ /**
+ * Release resources owned by this reply.
+ */
+ default void release() {
+ }
+
+ @Override
+ default void close() {
+ release();
+ }
Review Comment:
@szetszwo thanks for the review and further refactor suggestion!
I've opened a separate PR for introducing new `DataStreamReply` for
`ByteBuf` as your provided patch: https://github.com/apache/ratis/pull/1485
please take a look. Thanks!
--
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]