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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]