scwhittle commented on code in PR #23492:
URL: https://github.com/apache/beam/pull/23492#discussion_r1098588740


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindmillStateInternals.java:
##########
@@ -1721,20 +1729,20 @@ public Iterable<V> read() {
             return Collections.emptyList();
           }
 
-          if (localRemovals.contains(structuralKey)) {
+          if (keyState.removedLocally) {
             // this key has been removed locally but the removal hasn't been 
sent to windmill,
             // thus values in windmill(if any) are obsolete, and we only care 
about local values.
-            return 
Iterables.unmodifiableIterable(localAdditions.get(structuralKey));
+            return Iterables.unmodifiableIterable(keyState.localAdditions);
           }
           if (keyState.valuesCached || complete) {
             return Iterables.unmodifiableIterable(
-                Iterables.concat(keyState.values, 
localAdditions.get(structuralKey)));
+                Iterables.concat(keyState.values, keyState.localAdditions));
           }
           Future<Iterable<V>> persistedData = getFutureForKey(key);
           try (Closeable scope = scopedReadState()) {
             final Iterable<V> persistedValues = persistedData.get();
             if (Iterables.isEmpty(persistedValues)) {
-              Collection<V> local = localAdditions.get(structuralKey);
+              Collection<V> local = keyState.localAdditions;
               if (local.isEmpty()) {
                 // empty in both cache and windmill, remove key from cache.
                 keyStateMap.remove(structuralKey);

Review Comment:
   Yeah calling get on lots of keys but then not adding/removing seems unlikely
   If it gets to large we'll just stop caching it too



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

Reply via email to