reuvenlax commented on code in PR #41867:
URL: https://github.com/apache/beam/pull/41867#discussion_r4765044503


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/FnApiStateAccessor.java:
##########
@@ -517,7 +519,7 @@ public ReadableState<Boolean> readLater() {
 
                   @Override
                   public Iterable<T> read() {
-                    return impl.get();

Review Comment:
   Seems worth doing wrapping calls for set, map, multimap, orderlist as well.



##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/StateBackedIterable.java:
##########
@@ -155,6 +155,9 @@ public boolean hasNext() {
     @Override
     public T next() {
       T value = wrappedIterator.next();
+      if (countObservers() == 0) {
+        return value;
+      }

Review Comment:
   maybe lazily allocate observerProxy here so we don't always allocate it for 
the countObservers()==0 case?



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