You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2022/06/27 03:45:54 UTC

[GitHub] [incubator-pegasus] foreverneverer commented on a diff in pull request #1019: Java client scan add hasNext method

foreverneverer commented on code in PR #1019:
URL: https://github.com/apache/incubator-pegasus/pull/1019#discussion_r906946986


##########
java-client/src/main/java/org/apache/pegasus/client/PegasusScanner.java:
##########
@@ -88,9 +88,27 @@ public PegasusScanner(
     _needCheckHash = needCheckHash;
     _incomplete = false;
     _fullScan = fullScan;
+    _nextItem = null;

Review Comment:
   The global variable will cause `thread-safe` problem,  in origin code, I remember it will `lock` before fetch `next`: https://github.com/WHBANG/incubator-pegasus/blob/bd099a9c963de8de4cd8ad4c80ca6bb9653d24cd/java-client/src/main/java/org/apache/pegasus/client/PegasusScanner.java#L125
   
   Please check and make sure the `refactor` is `thread-safe`



-- 
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: dev-unsubscribe@pegasus.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org