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/10/16 12:38:05 UTC

[GitHub] [flink] WeiZhong94 opened a new pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

WeiZhong94 opened a new pull request #13665:
URL: https://github.com/apache/flink/pull/13665


   ## What is the purpose of the change
   
   *This pull request supports MapState and MapView in PyFlink.*
   
   
   ## Brief change log
   
     - *Support MapState in PyFlink.*
     - *Support MapView in PyFlink.*
   
   ## Verifying this change
   
   This change is already covered by existing tests.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (yes)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (docs)
   


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e26065fdb81efa41621af00cab2121f7008014a4 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot commented on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e26065fdb81efa41621af00cab2121f7008014a4 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] dianfu closed pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #13665:
URL: https://github.com/apache/flink/pull/13665


   


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c2017611bdb2ebf7827dedad7df196bc77b07f02 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840) 
   * ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973",
       "triggerID" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6ae6404059eec6a0eebee7ce4643e68efc86ce1f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6ae6404059eec6a0eebee7ce4643e68efc86ce1f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * acc611e0a224ad1f9de40a81516a2510171518af Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973) 
   * 6ae6404059eec6a0eebee7ce4643e68efc86ce1f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973",
       "triggerID" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946) 
   * acc611e0a224ad1f9de40a81516a2510171518af Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] WeiZhong94 commented on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
WeiZhong94 commented on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-712830639


   @dianfu Thanks for your comments! I have updated this PR.


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973",
       "triggerID" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6ae6404059eec6a0eebee7ce4643e68efc86ce1f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7984",
       "triggerID" : "6ae6404059eec6a0eebee7ce4643e68efc86ce1f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * acc611e0a224ad1f9de40a81516a2510171518af Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973) 
   * 6ae6404059eec6a0eebee7ce4643e68efc86ce1f Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7984) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] dianfu commented on a change in pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #13665:
URL: https://github.com/apache/flink/pull/13665#discussion_r508192677



##########
File path: flink-python/pyflink/fn_execution/state_impl.py
##########
@@ -119,13 +121,331 @@ def clear(self):
         self._internal_state.clear()
 
 
+class CachedMapState(LRUCache):
+
+    def __init__(self, max_entries):
+        super(CachedMapState, self).__init__(max_entries, None)
+        self._all_data_cached = False
+        self._existed_keys = set()
+
+        def on_evict(key, value):
+            self._existed_keys.remove(key)
+            self._all_data_cached = False
+
+        self.set_on_evict(on_evict)
+
+    def set_all_data_cached(self):
+        self._all_data_cached = True
+
+    def is_all_data_cached(self):
+        return self._all_data_cached
+
+    def put(self, key, existed_and_value):
+        if existed_and_value[0]:
+            self._existed_keys.add(key)
+        super(CachedMapState, self).put(key, existed_and_value)
+
+    def get_cached_existed_keys(self):
+        return self._existed_keys
+
+
+class CachingMapStateHandler(object):
+    # GET request flags
+    GET_FLAG = 0
+    ITERATE_FLAG = 1
+    CHECK_EMPTY_FLAG = 2
+    # GET response flags
+    EXIST_FLAG = 0
+    IS_NONE_FLAG = 1
+    NOT_EXIST_FLAG = 2
+    IS_EMPTY_FLAG = 3
+    NOT_EMPTY_FLAG = 4
+    # APPEND request flags
+    DELETE = 0
+    SET_NONE = 1
+    SET_VALUE = 2
+
+    def __init__(self, caching_state_handler, max_cached_map_key_entries):
+        self._state_cache = caching_state_handler._state_cache
+        self._underlying = caching_state_handler._underlying
+        self._context = caching_state_handler._context
+        self._max_cached_map_key_entries = max_cached_map_key_entries
+
+    def _get_cache_token(self):
+        if not self._state_cache.is_cache_enabled():
+            return None
+        if self._context.user_state_cache_token:
+            return self._context.user_state_cache_token
+        else:
+            return self._context.bundle_cache_token
+
+    def blocking_get(self, state_key, map_key, map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if not cache_token:
+            # Cache disabled / no cache token. Can't do a lookup/store in the cache.
+            return self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+        # Cache lookup
+        cache_state_key = self._convert_to_cache_key(state_key)
+        cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+        if cached_map_state is None:
+            existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+            cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+            cached_map_state.put(map_key, (existed, value))
+            self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            return existed, value
+        else:
+            cached_value = cached_map_state.get(map_key)
+            if cached_value is None:
+                existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+                cached_map_state.put(map_key, (existed, value))
+                return existed, value
+            else:
+                return cached_value
+
+    def extend(self, state_key, items: List[Tuple[int, Any, Any]], map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is None:
+                cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+                self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            for request_flag, map_key, map_value in items:
+                if request_flag == self.DELETE:
+                    cached_map_state.put(map_key, (False, None))
+                elif request_flag == self.SET_NONE:
+                    cached_map_state.put(map_key, (True, None))
+                elif request_flag == self.SET_VALUE:
+                    cached_map_state.put(map_key, (True, map_value))
+                else:
+                    raise Exception("Unknown flag: " + str(request_flag))
+        self._append_raw(
+            state_key,
+            items,
+            map_key_coder,
+            map_value_coder)
+
+    def check_empty(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is not None:
+                if cached_map_state.is_all_data_cached() and \
+                        len(cached_map_state.get_cached_existed_keys()) == 0:
+                    return True
+                elif len(cached_map_state.get_cached_existed_keys()) > 0:
+                    return False
+        return self._check_empty_raw(state_key)
+
+    def clear(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            cache_key = self._convert_to_cache_key(state_key)
+            self._state_cache.evict(cache_key, cache_token)
+        return self._underlying.clear(state_key)
+
+    def _check_empty_raw(self, state_key):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.CHECK_EMPTY_FLAG)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        if data[0] == self.IS_EMPTY_FLAG:
+            return True
+        elif data[0] == self.NOT_EMPTY_FLAG:
+            return False
+        else:
+            raise Exception("Unknown response flag: " + str(data[0]))
+
+    def _get_raw(self, state_key, map_key, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.GET_FLAG)
+        map_key_coder.encode_to_stream(map_key, output_stream, True)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        input_stream = coder_impl.create_InputStream(data)
+        result_flag = input_stream.read_byte()
+        if result_flag == self.EXIST_FLAG:
+            return True, map_value_coder.decode_from_stream(input_stream, True)
+        elif result_flag == self.IS_NONE_FLAG:
+            return True, None
+        elif result_flag == self.NOT_EXIST_FLAG:
+            return False, None
+        else:
+            raise Exception("Unknown response flag: " + str(result_flag))
+
+    def _append_raw(self, state_key, items, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_bigendian_int32(len(items))
+        for request_flag, map_key, map_value in items:
+            output_stream.write_byte(request_flag)
+            # Not all the coder impls will serialize the length of bytes when we set the "nested"
+            # param to "True", so we need to encode the length of bytes manually.
+            tmp_out = coder_impl.create_OutputStream()
+            map_key_coder.encode_to_stream(map_key, tmp_out, True)
+            serialized_data = tmp_out.get()
+            output_stream.write_bigendian_int32(len(serialized_data))
+            output_stream.write(serialized_data)
+            if request_flag == self.SET_VALUE:
+                tmp_out = coder_impl.create_OutputStream()
+                map_value_coder.encode_to_stream(map_value, tmp_out, True)
+                serialized_data = tmp_out.get()
+                output_stream.write_bigendian_int32(len(serialized_data))
+                output_stream.write(serialized_data)
+        return self._underlying.append_raw(state_key, output_stream.get())
+
+    @staticmethod
+    def _convert_to_cache_key(state_key):
+        return state_key.SerializeToString()
+
+
+class InternalSynchronousMapRuntimeState(object):
+
+    def __init__(self,
+                 map_state_handler: CachingMapStateHandler,
+                 state_key,
+                 map_key_coder,
+                 map_value_coder,
+                 max_write_cache_entries):
+        self._map_state_handler = map_state_handler
+        self._state_key = state_key
+        self._map_key_coder = map_key_coder
+        self._map_key_coder_impl = map_key_coder._create_impl()
+        self._map_value_coder = map_value_coder
+        self._map_value_coder_impl = map_value_coder._create_impl()
+        self._write_cache = dict()
+        self._max_write_cache_entries = max_write_cache_entries
+        self._is_empty = None
+        self._cleared = False
+
+    def get(self, map_key):
+        if map_key in self._write_cache:
+            existed_and_value = self._write_cache[map_key]
+            if existed_and_value[0]:
+                return existed_and_value[1]
+            else:
+                raise KeyError("Mapping key %s not found!" % map_key)

Review comment:
       Mapping key -> Map key? Need also check the other places.

##########
File path: flink-python/src/main/java/org/apache/flink/table/runtime/operators/python/aggregate/PythonStreamGroupAggregateOperator.java
##########
@@ -136,7 +136,14 @@
 	/**
 	 * The maximum NUMBER of the states cached in Python side.
 	 */
-	private int stateCacheSize;
+	private final int stateCacheSize;
+
+	/**
+	 * The maximum number of cached items which read from Java side in a Python MapState.

Review comment:
       ```suggestion
   	 * The maximum number of cached entries in a single Python MapState.
   ```

##########
File path: flink-python/src/main/java/org/apache/flink/streaming/api/runners/python/beam/BeamPythonFunctionRunner.java
##########
@@ -636,5 +670,173 @@ private static StateRequestHandler getStateRequestHandler(
 				VoidNamespaceSerializer.INSTANCE,
 				listStateDescriptor);
 		}
+
+		private CompletionStage<BeamFnApi.StateResponse.Builder> handleMapState(
+			BeamFnApi.StateRequest request) throws Exception {
+			// Currently the `beam_fn_api.proto` does not support MapState, so we use the
+			// the `MultimapSideInput` message to mark the state as a MapState for now.
+			if (request.getStateKey().hasMultimapSideInput()) {
+				BeamFnApi.StateKey.MultimapSideInput mapUserState = request.getStateKey().getMultimapSideInput();
+				// get key
+				byte[] keyBytes = mapUserState.getKey().toByteArray();
+				bais.setBuffer(keyBytes, 0, keyBytes.length);
+				Object key = keySerializer.deserialize(baisWrapper);
+				keyedStateBackend.setCurrentKey(
+					((RowDataSerializer) keyedStateBackend.getKeySerializer()).toBinaryRow((RowData) key));
+			} else {
+				throw new RuntimeException("Unsupported bag state request: " + request);
+			}
+
+			switch (request.getRequestCase()) {
+				case GET:
+					return handleMapGetRequest(request);
+				case APPEND:
+					return handleMapAppendRequest(request);
+				case CLEAR:
+					return handleMapClearRequest(request);
+				default:
+					throw new RuntimeException(
+						String.format(
+							"Unsupported request type %s for user state.", request.getRequestCase()));
+			}
+		}
+
+		private CompletionStage<BeamFnApi.StateResponse.Builder> handleMapGetRequest(BeamFnApi.StateRequest request)
+				throws Exception {
+			// The structure of get request bytes is:
+			// [flag(1 byte)][serialized map key(if needed)]
+			byte[] getRequest = request.getGet().getContinuationToken().toByteArray();
+			byte getFlag = getRequest[0];
+			if (reuseByteArrayWrapper == null) {
+				reuseByteArrayWrapper = new ByteArrayWrapper(getRequest, 1);

Review comment:
       what about initializing reuseByteArrayWrapper in the constructor?

##########
File path: flink-python/src/main/java/org/apache/flink/streaming/api/utils/ByteArrayWrapper.java
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.api.typeutils;
+
+import java.io.Serializable;
+
+/**
+ * A wrapper of the byte array. This class is used to calculate a deterministic hash code of a byte array.
+ */

Review comment:
       @internal

##########
File path: flink-python/src/main/java/org/apache/flink/streaming/api/utils/ByteArrayWrapperSerializer.java
##########
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.api.typeutils;

Review comment:
       package name is incorrect

##########
File path: flink-python/pyflink/fn_execution/state_impl.py
##########
@@ -191,19 +550,57 @@ def _create_state(self, state_spec: userstate.StateSpec) -> userstate.Accumulati
         else:
             raise NotImplementedError(state_spec)
 
+    def _create_internal_map_state(self, name, map_key_coder, map_value_coder):
+        # Currently the `beam_fn_api.proto` does not support MapState, so we use the
+        # the `MultimapSideInput` message to mark the state as a MapState for now.
+        state_key = beam_fn_api_pb2.StateKey(
+            multimap_side_input=beam_fn_api_pb2.StateKey.MultimapSideInput(
+                transform_id="",
+                side_input_id=name,
+                key=self._encoded_current_key))
+        return InternalSynchronousMapRuntimeState(
+            self._map_state_handler,
+            state_key,
+            map_key_coder,
+            map_value_coder,
+            self._map_state_write_cache_size)
+
     def set_current_key(self, key):
+        if key == self._current_key:
+            return
+        encoded_old_key = self._encoded_current_key
         self._current_key = key
         self._encoded_current_key = self._key_coder_impl.encode_nested(self._current_key)
         for state_name, state_obj in self._all_states.items():
-            state_obj._internal_state = \
-                self._get_internal_bag_state(state_name, state_obj._internal_state._value_coder)
+            if self._state_cache_size > 0:
+                # cache old internal state
+                self._internal_state_cache.put(
+                    (state_name, encoded_old_key), state_obj._internal_state)
+            if isinstance(state_obj, (SynchronousValueRuntimeState, SynchronousListRuntimeState)):
+                state_obj._internal_state = self._get_internal_bag_state(
+                    state_name, state_obj._internal_state._value_coder)
+            elif isinstance(state_obj, SynchronousMapRuntimeState):
+                state_obj._internal_state = self._get_internal_map_state(
+                    state_name,
+                    state_obj._internal_state._map_key_coder,
+                    state_obj._internal_state._map_value_coder)
+            else:
+                raise Exception("Unknown internal state '%s': %s" % (state_name, state_obj))
 
     def get_current_key(self):
         return self._current_key
 
     def commit(self):
-        for internal_state in self._all_internal_states:
-            internal_state.commit()
-            # reset the status of the internal state to reuse the object cross bundle
+        for internal_state in self._internal_state_cache:
+            self.commit_internal_state(None, internal_state)
+        for name, state in self._all_states.items():
+            if (name, self._encoded_current_key) not in self._internal_state_cache:
+                self.commit_internal_state(None, state._internal_state)
+
+    @staticmethod
+    def commit_internal_state(key, internal_state):

Review comment:
       key is not used

##########
File path: flink-python/src/main/java/org/apache/flink/streaming/api/utils/ByteArrayWrapperSerializer.java
##########
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.streaming.api.typeutils;
+
+import org.apache.flink.api.common.typeutils.SimpleTypeSerializerSnapshot;
+import org.apache.flink.api.common.typeutils.TypeSerializerSnapshot;
+import org.apache.flink.api.common.typeutils.base.TypeSerializerSingleton;
+import org.apache.flink.core.memory.DataInputView;
+import org.apache.flink.core.memory.DataOutputView;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+/**
+ * The serializer of {@link ByteArrayWrapper}.
+ */

Review comment:
       @Internal

##########
File path: flink-python/pyflink/fn_execution/state_impl.py
##########
@@ -119,13 +121,331 @@ def clear(self):
         self._internal_state.clear()
 
 
+class CachedMapState(LRUCache):
+
+    def __init__(self, max_entries):
+        super(CachedMapState, self).__init__(max_entries, None)
+        self._all_data_cached = False
+        self._existed_keys = set()
+
+        def on_evict(key, value):
+            self._existed_keys.remove(key)
+            self._all_data_cached = False
+
+        self.set_on_evict(on_evict)
+
+    def set_all_data_cached(self):
+        self._all_data_cached = True
+
+    def is_all_data_cached(self):
+        return self._all_data_cached
+
+    def put(self, key, existed_and_value):
+        if existed_and_value[0]:
+            self._existed_keys.add(key)
+        super(CachedMapState, self).put(key, existed_and_value)
+
+    def get_cached_existed_keys(self):
+        return self._existed_keys
+
+
+class CachingMapStateHandler(object):
+    # GET request flags
+    GET_FLAG = 0
+    ITERATE_FLAG = 1
+    CHECK_EMPTY_FLAG = 2
+    # GET response flags
+    EXIST_FLAG = 0
+    IS_NONE_FLAG = 1
+    NOT_EXIST_FLAG = 2
+    IS_EMPTY_FLAG = 3
+    NOT_EMPTY_FLAG = 4
+    # APPEND request flags
+    DELETE = 0
+    SET_NONE = 1
+    SET_VALUE = 2
+
+    def __init__(self, caching_state_handler, max_cached_map_key_entries):
+        self._state_cache = caching_state_handler._state_cache
+        self._underlying = caching_state_handler._underlying
+        self._context = caching_state_handler._context
+        self._max_cached_map_key_entries = max_cached_map_key_entries
+
+    def _get_cache_token(self):
+        if not self._state_cache.is_cache_enabled():
+            return None
+        if self._context.user_state_cache_token:
+            return self._context.user_state_cache_token
+        else:
+            return self._context.bundle_cache_token
+
+    def blocking_get(self, state_key, map_key, map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if not cache_token:
+            # Cache disabled / no cache token. Can't do a lookup/store in the cache.
+            return self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+        # Cache lookup
+        cache_state_key = self._convert_to_cache_key(state_key)
+        cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+        if cached_map_state is None:
+            existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+            cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+            cached_map_state.put(map_key, (existed, value))
+            self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            return existed, value
+        else:
+            cached_value = cached_map_state.get(map_key)
+            if cached_value is None:
+                existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+                cached_map_state.put(map_key, (existed, value))
+                return existed, value
+            else:
+                return cached_value
+
+    def extend(self, state_key, items: List[Tuple[int, Any, Any]], map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is None:
+                cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+                self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            for request_flag, map_key, map_value in items:
+                if request_flag == self.DELETE:
+                    cached_map_state.put(map_key, (False, None))
+                elif request_flag == self.SET_NONE:
+                    cached_map_state.put(map_key, (True, None))
+                elif request_flag == self.SET_VALUE:
+                    cached_map_state.put(map_key, (True, map_value))
+                else:
+                    raise Exception("Unknown flag: " + str(request_flag))
+        self._append_raw(
+            state_key,
+            items,
+            map_key_coder,
+            map_value_coder)
+
+    def check_empty(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is not None:
+                if cached_map_state.is_all_data_cached() and \
+                        len(cached_map_state.get_cached_existed_keys()) == 0:
+                    return True
+                elif len(cached_map_state.get_cached_existed_keys()) > 0:
+                    return False
+        return self._check_empty_raw(state_key)
+
+    def clear(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            cache_key = self._convert_to_cache_key(state_key)
+            self._state_cache.evict(cache_key, cache_token)
+        return self._underlying.clear(state_key)
+
+    def _check_empty_raw(self, state_key):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.CHECK_EMPTY_FLAG)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        if data[0] == self.IS_EMPTY_FLAG:
+            return True
+        elif data[0] == self.NOT_EMPTY_FLAG:
+            return False
+        else:
+            raise Exception("Unknown response flag: " + str(data[0]))
+
+    def _get_raw(self, state_key, map_key, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.GET_FLAG)
+        map_key_coder.encode_to_stream(map_key, output_stream, True)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        input_stream = coder_impl.create_InputStream(data)
+        result_flag = input_stream.read_byte()
+        if result_flag == self.EXIST_FLAG:
+            return True, map_value_coder.decode_from_stream(input_stream, True)
+        elif result_flag == self.IS_NONE_FLAG:
+            return True, None
+        elif result_flag == self.NOT_EXIST_FLAG:
+            return False, None
+        else:
+            raise Exception("Unknown response flag: " + str(result_flag))
+
+    def _append_raw(self, state_key, items, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_bigendian_int32(len(items))
+        for request_flag, map_key, map_value in items:
+            output_stream.write_byte(request_flag)
+            # Not all the coder impls will serialize the length of bytes when we set the "nested"
+            # param to "True", so we need to encode the length of bytes manually.
+            tmp_out = coder_impl.create_OutputStream()
+            map_key_coder.encode_to_stream(map_key, tmp_out, True)
+            serialized_data = tmp_out.get()
+            output_stream.write_bigendian_int32(len(serialized_data))
+            output_stream.write(serialized_data)
+            if request_flag == self.SET_VALUE:
+                tmp_out = coder_impl.create_OutputStream()
+                map_value_coder.encode_to_stream(map_value, tmp_out, True)
+                serialized_data = tmp_out.get()
+                output_stream.write_bigendian_int32(len(serialized_data))
+                output_stream.write(serialized_data)
+        return self._underlying.append_raw(state_key, output_stream.get())
+
+    @staticmethod
+    def _convert_to_cache_key(state_key):
+        return state_key.SerializeToString()
+
+
+class InternalSynchronousMapRuntimeState(object):
+
+    def __init__(self,
+                 map_state_handler: CachingMapStateHandler,
+                 state_key,
+                 map_key_coder,
+                 map_value_coder,
+                 max_write_cache_entries):
+        self._map_state_handler = map_state_handler
+        self._state_key = state_key
+        self._map_key_coder = map_key_coder
+        self._map_key_coder_impl = map_key_coder._create_impl()
+        self._map_value_coder = map_value_coder
+        self._map_value_coder_impl = map_value_coder._create_impl()
+        self._write_cache = dict()
+        self._max_write_cache_entries = max_write_cache_entries
+        self._is_empty = None
+        self._cleared = False
+
+    def get(self, map_key):
+        if map_key in self._write_cache:
+            existed_and_value = self._write_cache[map_key]
+            if existed_and_value[0]:
+                return existed_and_value[1]
+            else:
+                raise KeyError("Mapping key %s not found!" % map_key)
+        if self._cleared:
+            raise KeyError("Mapping key %s not found!" % map_key)
+        existed, value = self._map_state_handler.blocking_get(
+            self._state_key, map_key, self._map_key_coder_impl, self._map_value_coder_impl)
+        if existed:
+            return value
+        else:
+            raise KeyError("Mapping key %s not found!" % map_key)
+
+    def put(self, map_key, map_value):
+        self._write_cache[map_key] = (True, map_value)
+        self._is_empty = False
+        if len(self._write_cache) >= self._max_write_cache_entries:
+            self.commit()
+
+    def put_all(self, dict_value):
+        for map_key, map_value in dict_value:
+            self._write_cache[map_key] = (True, map_value)
+        self._is_empty = False
+        if len(self._write_cache) >= self._max_write_cache_entries:
+            self.commit()
+
+    def remove(self, map_key):
+        self._write_cache[map_key] = (False, None)
+        self._is_empty = None
+        if len(self._write_cache) >= self._max_write_cache_entries:
+            self.commit()
+
+    def contains(self, map_key):
+        try:
+            self.get(map_key)
+            return True
+        except KeyError:
+            return False
+
+    def is_empty(self):
+        if self._is_empty is None:
+            self._is_empty = self._map_state_handler.check_empty(self._state_key)
+        return self._is_empty
+
+    def clear(self):
+        self._cleared = True
+        self._is_empty = True
+        self._write_cache.clear()
+
+    def commit(self):
+        to_await = None
+        if self._cleared:
+            to_await = self._map_state_handler.clear(self._state_key)
+        if self._write_cache:
+            append_items = []
+            for map_key, existed_and_value in self._write_cache.items():

Review comment:
       ```suggestion
               for map_key, (exists, value) in self._write_cache.items():
   ```

##########
File path: flink-python/src/main/java/org/apache/flink/python/PythonOptions.java
##########
@@ -173,4 +173,24 @@
 		.defaultValue(1000)
 		.withDescription("The maximum number of states cached in a Python UDF worker. Note that this " +
 			"is an experimental flag and might not be available in future releases.");
+
+	/**
+	 * The maximum number of cached items which read from Java side in a Python MapState.
+	 */
+	@Experimental
+	public static final ConfigOption<Integer> MAP_STATE_READ_CACHE_SIZE = ConfigOptions
+		.key("python.map-state.read.cache.size")
+		.defaultValue(1000)
+		.withDescription("The maximum number of cached items which read from Java side in a Python MapState. "
+			+ "Note that this is an experimental flag and might not be available in future releases.");
+
+	/**
+	 * The maximum number of write requests cached in a Python MapState.
+	 */
+	@Experimental
+	public static final ConfigOption<Integer> MAP_STATE_WRITE_CACHE_SIZE = ConfigOptions
+		.key("python.map-state.write.cache.size")
+		.defaultValue(1000)
+		.withDescription("The maximum number of write requests cached in a Python MapState. Note that this " +

Review comment:
       ```suggestion
   		.withDescription("The maximum number of cached write requests for a single Python MapState. The write requests will be flushed to the state backend (managed in the Java operator) when the number of cached write requests exceed this limit. Note that this " +
   ```

##########
File path: flink-python/src/main/java/org/apache/flink/python/PythonOptions.java
##########
@@ -173,4 +173,24 @@
 		.defaultValue(1000)
 		.withDescription("The maximum number of states cached in a Python UDF worker. Note that this " +
 			"is an experimental flag and might not be available in future releases.");
+
+	/**
+	 * The maximum number of cached items which read from Java side in a Python MapState.
+	 */
+	@Experimental
+	public static final ConfigOption<Integer> MAP_STATE_READ_CACHE_SIZE = ConfigOptions
+		.key("python.map-state.read.cache.size")
+		.defaultValue(1000)
+		.withDescription("The maximum number of cached items which read from Java side in a Python MapState. "

Review comment:
       ```suggestion
   		.withDescription("The maximum number of cached entries for a single Python MapState. "
   ```

##########
File path: flink-python/pyflink/fn_execution/state_impl.py
##########
@@ -119,13 +121,331 @@ def clear(self):
         self._internal_state.clear()
 
 
+class CachedMapState(LRUCache):
+
+    def __init__(self, max_entries):
+        super(CachedMapState, self).__init__(max_entries, None)
+        self._all_data_cached = False
+        self._existed_keys = set()
+
+        def on_evict(key, value):
+            self._existed_keys.remove(key)
+            self._all_data_cached = False
+
+        self.set_on_evict(on_evict)
+
+    def set_all_data_cached(self):
+        self._all_data_cached = True
+
+    def is_all_data_cached(self):
+        return self._all_data_cached
+
+    def put(self, key, existed_and_value):
+        if existed_and_value[0]:
+            self._existed_keys.add(key)
+        super(CachedMapState, self).put(key, existed_and_value)
+
+    def get_cached_existed_keys(self):
+        return self._existed_keys
+
+
+class CachingMapStateHandler(object):
+    # GET request flags
+    GET_FLAG = 0
+    ITERATE_FLAG = 1
+    CHECK_EMPTY_FLAG = 2
+    # GET response flags
+    EXIST_FLAG = 0
+    IS_NONE_FLAG = 1
+    NOT_EXIST_FLAG = 2
+    IS_EMPTY_FLAG = 3
+    NOT_EMPTY_FLAG = 4
+    # APPEND request flags
+    DELETE = 0
+    SET_NONE = 1
+    SET_VALUE = 2
+
+    def __init__(self, caching_state_handler, max_cached_map_key_entries):
+        self._state_cache = caching_state_handler._state_cache
+        self._underlying = caching_state_handler._underlying
+        self._context = caching_state_handler._context
+        self._max_cached_map_key_entries = max_cached_map_key_entries
+
+    def _get_cache_token(self):
+        if not self._state_cache.is_cache_enabled():
+            return None
+        if self._context.user_state_cache_token:
+            return self._context.user_state_cache_token
+        else:
+            return self._context.bundle_cache_token
+
+    def blocking_get(self, state_key, map_key, map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if not cache_token:
+            # Cache disabled / no cache token. Can't do a lookup/store in the cache.
+            return self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+        # Cache lookup
+        cache_state_key = self._convert_to_cache_key(state_key)
+        cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+        if cached_map_state is None:
+            existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+            cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+            cached_map_state.put(map_key, (existed, value))
+            self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            return existed, value
+        else:
+            cached_value = cached_map_state.get(map_key)
+            if cached_value is None:
+                existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+                cached_map_state.put(map_key, (existed, value))
+                return existed, value
+            else:
+                return cached_value
+
+    def extend(self, state_key, items: List[Tuple[int, Any, Any]], map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is None:
+                cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+                self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            for request_flag, map_key, map_value in items:
+                if request_flag == self.DELETE:
+                    cached_map_state.put(map_key, (False, None))
+                elif request_flag == self.SET_NONE:
+                    cached_map_state.put(map_key, (True, None))
+                elif request_flag == self.SET_VALUE:
+                    cached_map_state.put(map_key, (True, map_value))
+                else:
+                    raise Exception("Unknown flag: " + str(request_flag))
+        self._append_raw(
+            state_key,
+            items,
+            map_key_coder,
+            map_value_coder)
+
+    def check_empty(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is not None:
+                if cached_map_state.is_all_data_cached() and \
+                        len(cached_map_state.get_cached_existed_keys()) == 0:
+                    return True
+                elif len(cached_map_state.get_cached_existed_keys()) > 0:
+                    return False
+        return self._check_empty_raw(state_key)
+
+    def clear(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            cache_key = self._convert_to_cache_key(state_key)
+            self._state_cache.evict(cache_key, cache_token)
+        return self._underlying.clear(state_key)
+
+    def _check_empty_raw(self, state_key):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.CHECK_EMPTY_FLAG)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        if data[0] == self.IS_EMPTY_FLAG:
+            return True
+        elif data[0] == self.NOT_EMPTY_FLAG:
+            return False
+        else:
+            raise Exception("Unknown response flag: " + str(data[0]))
+
+    def _get_raw(self, state_key, map_key, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.GET_FLAG)
+        map_key_coder.encode_to_stream(map_key, output_stream, True)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        input_stream = coder_impl.create_InputStream(data)
+        result_flag = input_stream.read_byte()
+        if result_flag == self.EXIST_FLAG:
+            return True, map_value_coder.decode_from_stream(input_stream, True)
+        elif result_flag == self.IS_NONE_FLAG:
+            return True, None
+        elif result_flag == self.NOT_EXIST_FLAG:
+            return False, None
+        else:
+            raise Exception("Unknown response flag: " + str(result_flag))
+
+    def _append_raw(self, state_key, items, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_bigendian_int32(len(items))
+        for request_flag, map_key, map_value in items:
+            output_stream.write_byte(request_flag)
+            # Not all the coder impls will serialize the length of bytes when we set the "nested"
+            # param to "True", so we need to encode the length of bytes manually.
+            tmp_out = coder_impl.create_OutputStream()
+            map_key_coder.encode_to_stream(map_key, tmp_out, True)
+            serialized_data = tmp_out.get()
+            output_stream.write_bigendian_int32(len(serialized_data))
+            output_stream.write(serialized_data)
+            if request_flag == self.SET_VALUE:
+                tmp_out = coder_impl.create_OutputStream()
+                map_value_coder.encode_to_stream(map_value, tmp_out, True)
+                serialized_data = tmp_out.get()
+                output_stream.write_bigendian_int32(len(serialized_data))
+                output_stream.write(serialized_data)
+        return self._underlying.append_raw(state_key, output_stream.get())
+
+    @staticmethod
+    def _convert_to_cache_key(state_key):
+        return state_key.SerializeToString()
+
+
+class InternalSynchronousMapRuntimeState(object):
+
+    def __init__(self,
+                 map_state_handler: CachingMapStateHandler,
+                 state_key,
+                 map_key_coder,
+                 map_value_coder,
+                 max_write_cache_entries):
+        self._map_state_handler = map_state_handler
+        self._state_key = state_key
+        self._map_key_coder = map_key_coder
+        self._map_key_coder_impl = map_key_coder._create_impl()
+        self._map_value_coder = map_value_coder
+        self._map_value_coder_impl = map_value_coder._create_impl()
+        self._write_cache = dict()
+        self._max_write_cache_entries = max_write_cache_entries
+        self._is_empty = None
+        self._cleared = False
+
+    def get(self, map_key):
+        if map_key in self._write_cache:
+            existed_and_value = self._write_cache[map_key]
+            if existed_and_value[0]:
+                return existed_and_value[1]
+            else:
+                raise KeyError("Mapping key %s not found!" % map_key)
+        if self._cleared:
+            raise KeyError("Mapping key %s not found!" % map_key)
+        existed, value = self._map_state_handler.blocking_get(

Review comment:
       ```suggestion
           exists, value = self._map_state_handler.blocking_get(
   ```

##########
File path: flink-python/pyflink/fn_execution/state_impl.py
##########
@@ -119,13 +121,331 @@ def clear(self):
         self._internal_state.clear()
 
 
+class CachedMapState(LRUCache):
+
+    def __init__(self, max_entries):
+        super(CachedMapState, self).__init__(max_entries, None)
+        self._all_data_cached = False
+        self._existed_keys = set()
+
+        def on_evict(key, value):
+            self._existed_keys.remove(key)
+            self._all_data_cached = False
+
+        self.set_on_evict(on_evict)
+
+    def set_all_data_cached(self):
+        self._all_data_cached = True
+
+    def is_all_data_cached(self):
+        return self._all_data_cached
+
+    def put(self, key, existed_and_value):
+        if existed_and_value[0]:
+            self._existed_keys.add(key)
+        super(CachedMapState, self).put(key, existed_and_value)
+
+    def get_cached_existed_keys(self):
+        return self._existed_keys
+
+
+class CachingMapStateHandler(object):
+    # GET request flags
+    GET_FLAG = 0
+    ITERATE_FLAG = 1
+    CHECK_EMPTY_FLAG = 2
+    # GET response flags
+    EXIST_FLAG = 0
+    IS_NONE_FLAG = 1
+    NOT_EXIST_FLAG = 2
+    IS_EMPTY_FLAG = 3
+    NOT_EMPTY_FLAG = 4
+    # APPEND request flags
+    DELETE = 0
+    SET_NONE = 1
+    SET_VALUE = 2
+
+    def __init__(self, caching_state_handler, max_cached_map_key_entries):
+        self._state_cache = caching_state_handler._state_cache
+        self._underlying = caching_state_handler._underlying
+        self._context = caching_state_handler._context
+        self._max_cached_map_key_entries = max_cached_map_key_entries
+
+    def _get_cache_token(self):
+        if not self._state_cache.is_cache_enabled():
+            return None
+        if self._context.user_state_cache_token:
+            return self._context.user_state_cache_token
+        else:
+            return self._context.bundle_cache_token
+
+    def blocking_get(self, state_key, map_key, map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if not cache_token:
+            # Cache disabled / no cache token. Can't do a lookup/store in the cache.
+            return self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+        # Cache lookup
+        cache_state_key = self._convert_to_cache_key(state_key)
+        cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+        if cached_map_state is None:
+            existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+            cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+            cached_map_state.put(map_key, (existed, value))
+            self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            return existed, value
+        else:
+            cached_value = cached_map_state.get(map_key)
+            if cached_value is None:
+                existed, value = self._get_raw(state_key, map_key, map_key_coder, map_value_coder)
+                cached_map_state.put(map_key, (existed, value))
+                return existed, value
+            else:
+                return cached_value
+
+    def extend(self, state_key, items: List[Tuple[int, Any, Any]], map_key_coder, map_value_coder):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is None:
+                cached_map_state = CachedMapState(self._max_cached_map_key_entries)
+                self._state_cache.put(cache_state_key, cache_token, cached_map_state)
+            for request_flag, map_key, map_value in items:
+                if request_flag == self.DELETE:
+                    cached_map_state.put(map_key, (False, None))
+                elif request_flag == self.SET_NONE:
+                    cached_map_state.put(map_key, (True, None))
+                elif request_flag == self.SET_VALUE:
+                    cached_map_state.put(map_key, (True, map_value))
+                else:
+                    raise Exception("Unknown flag: " + str(request_flag))
+        self._append_raw(
+            state_key,
+            items,
+            map_key_coder,
+            map_value_coder)
+
+    def check_empty(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            # Cache lookup
+            cache_state_key = self._convert_to_cache_key(state_key)
+            cached_map_state = self._state_cache.get(cache_state_key, cache_token)
+            if cached_map_state is not None:
+                if cached_map_state.is_all_data_cached() and \
+                        len(cached_map_state.get_cached_existed_keys()) == 0:
+                    return True
+                elif len(cached_map_state.get_cached_existed_keys()) > 0:
+                    return False
+        return self._check_empty_raw(state_key)
+
+    def clear(self, state_key):
+        cache_token = self._get_cache_token()
+        if cache_token:
+            cache_key = self._convert_to_cache_key(state_key)
+            self._state_cache.evict(cache_key, cache_token)
+        return self._underlying.clear(state_key)
+
+    def _check_empty_raw(self, state_key):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.CHECK_EMPTY_FLAG)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        if data[0] == self.IS_EMPTY_FLAG:
+            return True
+        elif data[0] == self.NOT_EMPTY_FLAG:
+            return False
+        else:
+            raise Exception("Unknown response flag: " + str(data[0]))
+
+    def _get_raw(self, state_key, map_key, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_byte(self.GET_FLAG)
+        map_key_coder.encode_to_stream(map_key, output_stream, True)
+        continuation_token = output_stream.get()
+        data, response_token = self._underlying.get_raw(state_key, continuation_token)
+        input_stream = coder_impl.create_InputStream(data)
+        result_flag = input_stream.read_byte()
+        if result_flag == self.EXIST_FLAG:
+            return True, map_value_coder.decode_from_stream(input_stream, True)
+        elif result_flag == self.IS_NONE_FLAG:
+            return True, None
+        elif result_flag == self.NOT_EXIST_FLAG:
+            return False, None
+        else:
+            raise Exception("Unknown response flag: " + str(result_flag))
+
+    def _append_raw(self, state_key, items, map_key_coder, map_value_coder):
+        output_stream = coder_impl.create_OutputStream()
+        output_stream.write_bigendian_int32(len(items))
+        for request_flag, map_key, map_value in items:
+            output_stream.write_byte(request_flag)
+            # Not all the coder impls will serialize the length of bytes when we set the "nested"
+            # param to "True", so we need to encode the length of bytes manually.
+            tmp_out = coder_impl.create_OutputStream()
+            map_key_coder.encode_to_stream(map_key, tmp_out, True)
+            serialized_data = tmp_out.get()
+            output_stream.write_bigendian_int32(len(serialized_data))
+            output_stream.write(serialized_data)
+            if request_flag == self.SET_VALUE:
+                tmp_out = coder_impl.create_OutputStream()
+                map_value_coder.encode_to_stream(map_value, tmp_out, True)
+                serialized_data = tmp_out.get()
+                output_stream.write_bigendian_int32(len(serialized_data))
+                output_stream.write(serialized_data)
+        return self._underlying.append_raw(state_key, output_stream.get())
+
+    @staticmethod
+    def _convert_to_cache_key(state_key):
+        return state_key.SerializeToString()
+
+
+class InternalSynchronousMapRuntimeState(object):
+
+    def __init__(self,
+                 map_state_handler: CachingMapStateHandler,
+                 state_key,
+                 map_key_coder,
+                 map_value_coder,
+                 max_write_cache_entries):
+        self._map_state_handler = map_state_handler
+        self._state_key = state_key
+        self._map_key_coder = map_key_coder
+        self._map_key_coder_impl = map_key_coder._create_impl()
+        self._map_value_coder = map_value_coder
+        self._map_value_coder_impl = map_value_coder._create_impl()
+        self._write_cache = dict()
+        self._max_write_cache_entries = max_write_cache_entries
+        self._is_empty = None
+        self._cleared = False
+
+    def get(self, map_key):
+        if map_key in self._write_cache:
+            existed_and_value = self._write_cache[map_key]

Review comment:
       ```suggestion
               (exists, value) = self._write_cache[map_key]
   ```




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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c2017611bdb2ebf7827dedad7df196bc77b07f02 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840) 
   * ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973",
       "triggerID" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * acc611e0a224ad1f9de40a81516a2510171518af Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7973) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946",
       "triggerID" : "ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "acc611e0a224ad1f9de40a81516a2510171518af",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab7e6fb1ee0ffa2f5cb68dfb03579b84b116afa3 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7946) 
   * acc611e0a224ad1f9de40a81516a2510171518af UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c2017611bdb2ebf7827dedad7df196bc77b07f02 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7840) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot edited a comment on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710028722


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757",
       "triggerID" : "e26065fdb81efa41621af00cab2121f7008014a4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c2017611bdb2ebf7827dedad7df196bc77b07f02",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e26065fdb81efa41621af00cab2121f7008014a4 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=7757) 
   * c2017611bdb2ebf7827dedad7df196bc77b07f02 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


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



[GitHub] [flink] flinkbot commented on pull request #13665: [FLINK-19232][python] Support MapState and MapView in PyFlink.

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13665:
URL: https://github.com/apache/flink/pull/13665#issuecomment-710021091


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit e26065fdb81efa41621af00cab2121f7008014a4 (Fri Oct 16 12:41:05 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-19232).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


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