You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/11/23 11:33:35 UTC

[GitHub] [incubator-ratis] runzhiwang commented on a change in pull request #294: RATIS-1171. Allow null for the stream parameter in StateMachine.DataApi.link

runzhiwang commented on a change in pull request #294:
URL: https://github.com/apache/incubator-ratis/pull/294#discussion_r528638515



##########
File path: ratis-test/src/test/java/org/apache/ratis/datastream/DataStreamTestUtils.java
##########
@@ -76,18 +80,34 @@ static ByteString bytesWritten2ByteString(long bytesWritten) {
 
     @Override
     public CompletableFuture<?> link(DataStream stream, LogEntryProto entry) {
-      final SingleDataStream s = getSingleDataStream(ClientInvocationId.valueOf(entry.getStateMachineLogEntry()));
-      s.setLogEntry(entry);
+      LOG.info("link {}", stream);
+      if (stream == null) {
+        return JavaUtils.completeExceptionally(new IllegalStateException("Null stream: entry=" + entry));
+      }
+      ((SingleDataStream)stream).setLogEntry(entry);
       return CompletableFuture.completedFuture(null);
     }
 
+    @Override
+    public CompletableFuture<Message> applyTransaction(TransactionContext trx) {

Review comment:
       @szetszwo Hi, sorry, why we need to override applyTransaction ? seems no test need this.




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

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