tzulitai commented on a change in pull request #42: [FLINK-16390][sdk] Add view 
and clear methods to PersistedTable
URL: https://github.com/apache/flink-statefun/pull/42#discussion_r386763061
 
 

 ##########
 File path: 
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/state/FlinkTableAccessor.java
 ##########
 @@ -55,4 +57,19 @@ public void remove(K key) {
       throw new RuntimeException(e);
     }
   }
+
+  @Override
+  public Iterable<Map.Entry<K, V>> view() {
+    try {
+      Iterable<Map.Entry<K, V>> entries = handle.entries();
+      return entries == null ? Collections.emptyList() : entries;
 
 Review comment:
   Actually, I think Flink user `MapState` never returns `null` for `entries()` 
/ `keys()` / `values()`.
   
   The actual `MapState` handle that the user gets is always a 
`UserFacingMapState` in Flink that wraps the actual RocksDB / heap map state 
handle, which uses an empty map state if the wrapped state handle returns 
`null` for those methods.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to