Github user yanghua commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6134#discussion_r193651829
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyedStateFunction.java
 ---
    @@ -25,13 +25,13 @@
      * <p>This functionality is only available through the
      * {@code BroadcastConnectedStream.process(final 
KeyedBroadcastProcessFunction function)}.
      */
    -public abstract class KeyedStateFunction<K, S extends State> {
    +public interface KeyedStateFunction<K, S extends State> {
    --- End diff --
    
    @dawidwys can I change current usage like : 
    
    ```
    // valid state value via applyToAllKeys().
                        backend.applyToAllKeys(VoidNamespace.INSTANCE, 
VoidNamespaceSerializer.INSTANCE, listStateDescriptor,
                                new KeyedStateFunction<Integer, 
ListState<String>>() {
                                        @Override
                                        public void process(Integer key, 
ListState<String> state) throws Exception {
                                                assertEquals("Hello" + key, 
state.get().iterator().next());
                                        }
                                });
    
                        // clear state via applyToAllKeys().
                        backend.applyToAllKeys(VoidNamespace.INSTANCE, 
VoidNamespaceSerializer.INSTANCE, listStateDescriptor,
                                new KeyedStateFunction<Integer, 
ListState<String>>() {
                                        @Override
                                        public void process(Integer key, 
ListState<String> state) throws Exception {
                                                state.clear();
                                        }
                                });
    ```
    
    to lambda function style to verify the change?


---

Reply via email to