def append_raw( self, state_key, # type: beam_fn_api_pb2.StateKey data # type: bytes ): # type: (...) -> _Future with self._lock: self._state[self._to_key(state_key)].append(data) return _Future.done()
def clear(self, state_key): # type: (beam_fn_api_pb2.StateKey) -> _Future with self._lock: try: del self._state[self._to_key(state_key)] except KeyError: # This may happen with the caching layer across bundles. Caching may # skip this storage layer for a blocking_get(key) request. Without # the caching, the state for a key would be initialized via the # defaultdict that _state uses. pass return _Future.done()