You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/08/17 04:12:39 UTC

[GitHub] [ratis] szetszwo commented on a diff in pull request #716: RATIS-1647. Fix EI_EXPOSE_REP in DataStreamRequest implementations

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


##########
ratis-common/src/main/java/org/apache/ratis/protocol/DataStreamRequestHeader.java:
##########
@@ -37,8 +39,17 @@ public DataStreamRequestHeader(ClientId clientId, Type type, long streamId, long
     this.options = options;
   }
 
+  @SuppressFBWarnings("EI_EXPOSE_REP2")

Review Comment:
   Please update the constructor but not adding SuppressFBWarnings.



##########
ratis-client/src/main/java/org/apache/ratis/client/api/DataStreamOutput.java:
##########
@@ -39,6 +39,16 @@ public interface DataStreamOutput extends CloseAsync<DataStreamReply> {
    */
   CompletableFuture<DataStreamReply> writeAsync(ByteBuffer src, WriteOption... options);

Review Comment:
   Add the default implementation here.
   ```java
     /**
      * The same as writeAsync(src, Arrays.asList(options)).
      */
     default CompletableFuture<DataStreamReply> writeAsync(ByteBuffer src, WriteOption... options) {
       return writeAsync(src, Arrays.asList(options));
     }
   ```



##########
ratis-client/src/main/java/org/apache/ratis/client/impl/DataStreamClientImpl.java:
##########
@@ -126,7 +128,15 @@ private DataStreamOutputImpl(RaftClientRequest request) {
       this.headerFuture = send(Type.STREAM_HEADER, buffer, buffer.remaining());
     }
 
-    private CompletableFuture<DataStreamReply> send(Type type, Object data, long length, WriteOption... options) {
+    private CompletableFuture<DataStreamReply> send(Type type, Object data,
+                                                    long length,
+                                                    WriteOption... options) {
+      return this.send(type, data, length, Arrays.asList(options));
+    }

Review Comment:
   Remove this method.



-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org