Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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)))
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 def clear(self, state_key):
     return self._request(
         beam_fn_api_pb2.StateRequest(
             state_key=state_key,
             clear=beam_fn_api_pb2.StateClearRequest()))
Exemplo n.º 6
0
 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)))
Exemplo n.º 7
0
 def blocking_clear(self, state_key):
     self._blocking_request(
         beam_fn_api_pb2.StateRequest(
             state_key=state_key,
             clear=beam_fn_api_pb2.StateClearRequest()))
Exemplo n.º 8
0
 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)))
Exemplo n.º 9
0
 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()))
Exemplo n.º 10
0
 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()))
Exemplo n.º 11
0
 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)))