szetszwo commented on code in PR #1481:
URL: https://github.com/apache/ratis/pull/1481#discussion_r3423168322


##########
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:
   On a second thought, let's don't add release() and close() methods to 
DataStreamReply since 
   - DataStreamReplyByteBuffer does not need them, and
   - DataStreamRequest also does not have these methods.
   
   See 
https://issues.apache.org/jira/secure/attachment/13082808/1481_review2_DataStreamReply.patch



-- 
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]

Reply via email to