示例#1
0
 def _cleanup(self):
     # Last event log has to be preserved so we can continue enforcing
     # monotonicity. We entomb offset because that also has to be
     # monotonic, but the size does not.
     if 0 < self._index < len(self._logs):
         deleted = self._logs[:self._index]
         self._logs = self._logs[self._index:]
         self._index = 0
         self._entombed_progress += sum(l.get_offset() for l in deleted)
         util.close_all(deleted)
示例#2
0
 def _cleanup(self):
   # Last event log has to be preserved so we can continue enforcing
   # monotonicity. We entomb offset because that also has to be
   # monotonic, but the size does not.
   if 0 < self._index < len(self._logs):
     deleted = self._logs[:self._index]
     self._logs = self._logs[self._index:]
     self._index = 0
     self._entombed_progress += sum(l.get_offset() for l in deleted)
     util.close_all(deleted)
示例#3
0
    def close(self):
        """Closes all event log readers.

    This method may be called multiple times, but further operations
    are not permitted.

    Raises:
      Exception: To propagate the most recent exception thrown by the
          EventLogReader close method. Suppressed exceptions are
          logged.
    """
        util.close_all(self._logs)
        self._index = len(self._logs)
        self._mark = -1
        self._prepended_events.clear()
        self._saved_events.clear()
示例#4
0
  def close(self):
    """Closes all event log readers.

    This method may be called multiple times, but further operations
    are not permitted.

    Raises:
      Exception: To propagate the most recent exception thrown by the
          EventLogReader close method. Suppressed exceptions are
          logged.
    """
    util.close_all(self._logs)
    self._index = len(self._logs)
    self._mark = -1
    self._prepended_events.clear()
    self._saved_events.clear()