arunpandianp commented on code in PR #36313:
URL: https://github.com/apache/beam/pull/36313#discussion_r2457803067


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/state/WindmillStateCache.java:
##########
@@ -225,24 +225,23 @@ public long getWeight() {
 
   /** Entry in the state cache that stores a map of values. */
   private static class StateCacheEntry implements Weighted {
-    private final HashMap<NamespacedTag<?>, WeightedValue<?>> values;
+    private final IdentityHashMap<InternedByteString, WeightedValue<?>> values;

Review Comment:
   IIUC, having two different states with same tag/StateId inside the same 
stateFamily is not allowed. 
   
   The logic in 
https://github.com/apache/beam/blob/05f6f01a33b3bc9bb5b8b928c6854c98a8068e26/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnSignatures.java#L2282
 should prevent user from using duplicate StateId in a DoFn.
   
   The existing logic with `NamespacedTag` will also cause a collision if there 
are multiple StateTag with same tags.



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