You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/03/03 02:19:13 UTC
[GitHub] [flink-statefun] tzulitai commented on a change in pull request
#42: [FLINK-16390][sdk] Add view and clear methods to PersistedTable
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:
users@infra.apache.org
With regards,
Apache Git Services