Example #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
Example #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
Example #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)))
Example #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
Example #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()))
Example #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)))
Example #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()))
Example #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)))
Example #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()))
Example #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()))
Example #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)))