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



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/StateFetchingIterators.java
##########
@@ -84,10 +83,7 @@ private StateFetchingIterators() {}
       StateRequest stateRequestForFirstChunk,
       Coder<T> valueCoder) {
     return new CachingStateIterable<>(
-        (Cache<StateKey, Blocks<T>>) cache,
-        beamFnStateClient,
-        stateRequestForFirstChunk,
-        valueCoder);
+        (Cache<Object, Blocks<T>>) cache, beamFnStateClient, 
stateRequestForFirstChunk, valueCoder);

Review comment:
       I would suggest using a static object that is weighted that is internal. 
Using `null` hides useful information when debugging the caches contents. 
Please also update the method comment saying that the state cache should be 
namespaced for this object to prevent collisions (like BagUserState).
   
   Like 
   ```
   private static class IterableCacheKey implements Weighted {
     static INSTANCE = new IterableCacheKey();
     getWeight() {
       return 0;
     }
   }
   ```




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