You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/08/03 17:20:19 UTC

[GitHub] [beam] lukecwik commented on a change in pull request #15235: [BEAM-7745] Avoid uncached state fetches for streaming side-inputs

lukecwik commented on a change in pull request #15235:
URL: https://github.com/apache/beam/pull/15235#discussion_r681952111



##########
File path: runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillStateInternals.java
##########
@@ -474,9 +474,12 @@ private WindmillValue(
 
     @Override
     public void clear() {
-      modified = true;
+      // if the value was already null (because it was already cleared) then there's no need to

Review comment:
       Did you mean to include this as part of your change?

##########
File path: runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillStateInternals.java
##########
@@ -474,9 +474,12 @@ private WindmillValue(
 
     @Override
     public void clear() {
-      modified = true;
+      // if the value was already null (because it was already cleared) then there's no need to
+      // mark this as modified again.  This will save having to persist a clear that does nothing.

Review comment:
       Wouldn't two calls to `clear()` toggle `modified` from `true` to `false`?
   
   I think you would need to keep track of whether the value state is already in a cleared state instead of using ` value == null` as a proxy.
   
   This logic could really use unit tests to validate such simple scenarios.
   




-- 
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: github-unsubscribe@beam.apache.org

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