Skip to content
Snippets Groups Projects

Simplify a bit the multiplexer and readonly filter objstorages and other refactorings

Merged David Douard requested to merge douardda/swh-objstorage:factory-simplifications into master
  1. May 22, 2024
    • David Douard's avatar
      Make the ReadOnlyObjStorageProxy raise ReadOnlyObjStorageError when needed · daee75c0
      David Douard authored
      It used to do nothing, which is inconsistent with the behavior of the
      HTTPReadOnlyObjStorage.
      
      Adapt a bit the multiplexer to handle this properly:
      
      - keep a list of RW storage threads separated from the full list of
        backend storage threads
      - the decision is made using a call to check_config(check_write=True)
        for each of the backend storages
      - adapt a bit the API/behavior of the check_config() method to make it
        return False when called with 'check_write=True' for a RO obj storage,
      - for the multiplexer, check_config(check_write=True) returns True if at
        least one backend objstorage is green,
      - remove reference to deleted filters in the multiplexer doc string.
      daee75c0
    • David Douard's avatar
      Rename ReadOnlyObjStorage and NonIterableObjStorage exceptions · 315e84d0
      David Douard authored
      Add an 'Error' suffix so there is no confusion, especially with regard
      to the new ReadOnlyProxyObjStorage proxy objstorage class (even if it's
      not the same name, it can be very confusing).
      315e84d0
    • David Douard's avatar
      Simplify a bit the MultiplexerObjStorage · 59f19176
      David Douard authored
      Move the implementation in swh/objstorage/multiplexer.py since there is
      nothing left in the swh/objstorage/multiplexer/ but this class.
      
      Make the constructor able to instantiate the encapsulated objstorages so
      we can get rid of the factory _construct_multiplexer_objstorage
      function.
      59f19176
    • David Douard's avatar
      Convert the ObjStorageFilter as a simple proxy ObjStorage · d32b610c
      David Douard authored
      Get rid of the generic ObjStorageFilter complexity, since we only have a
      single filter. This allows also to get rid of the
      _construct_filtered_objstorage() factory function in factory.py; this later
      is only deprecated for now for bw compat, but uses the new
      ReadOnlyObjstorageProxy class instead.
      d32b610c
Loading