def blocking_get(self, state_key): response = self._blocking_request( beam_fn_api_pb2.StateRequest( state_key=state_key, get=beam_fn_api_pb2.StateGetRequest())) if response.get.continuation_token: raise NotImplementedError return response.get.data
def get_raw(self, state_key, continuation_token=None): response = self._blocking_request( beam_fn_api_pb2.StateRequest( state_key=state_key, get=beam_fn_api_pb2.StateGetRequest( continuation_token=continuation_token))) return response.get.data, response.get.continuation_token
def append_raw(self, state_key, # type: Optional[beam_fn_api_pb2.StateKey] data # type: bytes ): # type: (...) -> _Future return self._request( beam_fn_api_pb2.StateRequest( state_key=state_key, append=beam_fn_api_pb2.StateAppendRequest(data=data)))
def get_raw(self, state_key, # type: beam_fn_api_pb2.StateKey continuation_token=None # type: Optional[bytes] ): # type: (...) -> Tuple[bytes, Optional[bytes]] response = self._blocking_request( beam_fn_api_pb2.StateRequest( state_key=state_key, get=beam_fn_api_pb2.StateGetRequest( continuation_token=continuation_token))) return response.get.data, response.get.continuation_token
def clear(self, state_key): return self._request( beam_fn_api_pb2.StateRequest( state_key=state_key, clear=beam_fn_api_pb2.StateClearRequest()))
def append_raw(self, state_key, data): return self._request( beam_fn_api_pb2.StateRequest( state_key=state_key, append=beam_fn_api_pb2.StateAppendRequest(data=data)))
def blocking_clear(self, state_key): self._blocking_request( beam_fn_api_pb2.StateRequest( state_key=state_key, clear=beam_fn_api_pb2.StateClearRequest()))
def blocking_append(self, state_key, data): self._blocking_request( beam_fn_api_pb2.StateRequest( state_key=state_key, append=beam_fn_api_pb2.StateAppendRequest(data=data)))
def clear(self, state_key): # type: (Optional[beam_fn_api_pb2.StateKey]) -> _Future return self._request( beam_fn_api_pb2.StateRequest( state_key=state_key, clear=beam_fn_api_pb2.StateClearRequest()))
def blocking_clear(self, state_key, instruction_reference): self._blocking_request( beam_fn_api_pb2.StateRequest( instruction_reference=instruction_reference, state_key=state_key, clear=beam_fn_api_pb2.StateClearRequest()))
def blocking_append(self, state_key, data, instruction_reference): self._blocking_request( beam_fn_api_pb2.StateRequest( instruction_reference=instruction_reference, state_key=state_key, append=beam_fn_api_pb2.StateAppendRequest(data=data)))