sanha commented on a change in pull request #244: [NEMO-422] Address code 
quality issues for ResourceSitePass, NetworkTraceAnalysis, 
PhysicalPlanGenerator, and bytetransfer
URL: https://github.com/apache/incubator-nemo/pull/244#discussion_r336765182
 
 

 ##########
 File path: 
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/bytetransfer/ByteInputContext.java
 ##########
 @@ -44,7 +44,8 @@
 
   private final CompletableFuture<Iterator<InputStream>> completedFuture = new 
CompletableFuture<>();
   private final ClosableBlockingQueue<ByteBufInputStream> byteBufInputStreams 
= new ClosableBlockingQueue<>();
-  private volatile ByteBufInputStream currentByteBufInputStream = null;
+  private volatile boolean hasActiveInputStream = false;
+  private ByteBufInputStream currentByteBufInputStream = null;
 
 Review comment:
   Is it okay to non-volatilize the reference? It seems that a thread can see 
the `currentByteBufInputStream` which is `null` even if the 
`hasActiveInputStream` is true.
   If it is needed, you can just put a comment about it and ignore the 
SonarCloud issue.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to