Esempio n. 1
0
  def _advance(self):
    """Acquires additional logs via cursor.

    This method is used by the iterator when it has exhausted its current set of
    logs to acquire more logs and update its internal structures accordingly.
    """
    response = log_service_pb.LogReadResponse()

    apiproxy_stub_map.MakeSyncCall('logservice', 'Read', self._request,
                                   response)
    self._logs = response.log_list()
    self._request.clear_offset()
    if response.has_offset():
      self._request.mutable_offset().CopyFrom(response.offset())
Esempio n. 2
0
    def _advance(self):
        """Acquires additional logs via cursor.

    This method is used by the iterator when it has exhausted its current set of
    logs to acquire more logs and update its internal structures accordingly.
    """
        response = log_service_pb.LogReadResponse()

        try:
            apiproxy_stub_map.MakeSyncCall('logservice', 'Read', self._request,
                                           response)
        except apiproxy_errors.ApplicationError, e:
            if e.application_error == log_service_pb.LogServiceError.INVALID_REQUEST:
                raise InvalidArgumentError(e.error_detail)
            raise Error(e.error_detail)
Esempio n. 3
0
    def _advance(self):
        """Acquires additional logs via cursor.

    This method is used by the iterator when it has exhausted its current set of
    logs to acquire more logs and update its internal structures accordingly.
    """
        response = log_service_pb.LogReadResponse()

        try:
            apiproxy_stub_map.MakeSyncCall('logservice', 'Read', self._request,
                                           response)
        except apiproxy_errors.ApplicationError as e:
            if e.application_error == log_service_pb.LogServiceError.INVALID_REQUEST:
                raise InvalidArgumentError(e.error_detail)
            raise Error(e.error_detail)

        self._logs = response.log_list()
        self._request.clear_offset()
        if response.has_offset():
            self._request.mutable_offset().CopyFrom(response.offset())
        self._last_end_time = None
        if response.has_last_end_time():
            self._last_end_time = response.last_end_time() / 1e6