shunping commented on code in PR #32326:
URL: https://github.com/apache/beam/pull/32326#discussion_r1792727489


##########
sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py:
##########
@@ -1061,24 +1074,74 @@ def get_raw(self,
           'Unknown state type: ' + state_key.WhichOneof('type'))
 
     with self._lock:
-      full_state = self._state[self._to_key(state_key)]
-      if self._use_continuation_tokens:
-        # The token is "nonce:index".
-        if not continuation_token:
-          token_base = b'token_%x' % len(self._continuations)
-          self._continuations[token_base] = tuple(full_state)
-          return b'', b'%s:0' % token_base
+      if state_key.WhichOneof('type') == 'ordered_list_user_state':
+        maybe_start = state_key.ordered_list_user_state.range.start
+        maybe_end = state_key.ordered_list_user_state.range.end
+        persistent_state_key = beam_fn_api_pb2.StateKey()
+        persistent_state_key.CopyFrom(state_key)
+        persistent_state_key.ordered_list_user_state.ClearField("range")
+
+        available_keys = self._ordered_list_keys[self._to_key(
+            persistent_state_key)]
+
+        if self._use_continuation_tokens and continuation_token:

Review Comment:
   Done.



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