zhengbuqian commented on code in PR #23491:
URL: https://github.com/apache/beam/pull/23491#discussion_r993977351


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/state/StateSpecs.java:
##########
@@ -733,6 +771,69 @@ public int hashCode() {
     }
   }
 
+  private static class MultimapStateSpec<K, V> implements 
StateSpec<MultimapState<K, V>> {
+
+    private @Nullable Coder<K> keyCoder;
+    private @Nullable Coder<V> valueCoder;
+
+    private MultimapStateSpec(@Nullable Coder<K> keyCoder, @Nullable Coder<V> 
valueCoder) {
+      this.keyCoder = keyCoder;
+      this.valueCoder = valueCoder;
+    }
+
+    @Override
+    public MultimapState<K, V> bind(String id, StateBinder visitor) {
+      return visitor.bindMultimap(id, this, keyCoder, valueCoder);
+    }
+
+    @Override
+    public <ResultT> ResultT match(Cases<ResultT> cases) {
+      return cases.dispatchMap(keyCoder, valueCoder);

Review Comment:
   Good catch!



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