Page MenuHomeSoftware Heritage

Add new functionnality to the ObjStorage and align remote API to the local one
ClosedPublic

Authored by qcampos on Jul 27 2016, 3:45 PM.

Details

Summary
  • The method get_objstorage at the module top_level allows to easily create an ObjStorage given a unique class key and a dictionary of matching arguments.
  • Add the get_batch method to the base API so it is now possible to perform a get of multiple contents at the same time. This should be an improvement for the remote objstorage.
  • Align the RemoteObjStorage api to the bas ObjStorage one, and also update the tests that now uses the base tests for ObjStorage's implementations, which makes the code much simpler.

Diff Detail

Repository
rDOBJS Object storage
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

qcampos retitled this revision from to Add new functionnality to the ObjStorage and align remote API to the local one..
qcampos updated this object.
qcampos edited the test plan for this revision. (Show Details)
qcampos added a reviewer: olasd.
qcampos retitled this revision from Add new functionnality to the ObjStorage and align remote API to the local one. to Add new functionnality to the ObjStorage and align remote API to the local one.Jul 27 2016, 3:46 PM
qcampos edited edge metadata.
qcampos updated this object.

Please see comments on arguments for the generic instantiation functions.

You should add tests to make sure that the function works properly and that the argument structure is correct.

swh/objstorage/__init__.py
39–41 ↗(On Diff #271)

Why not make storage_conf and filters_conf directly keyword arguments for the function?

50 ↗(On Diff #271)

This is missing arguments for each storage, I believe (so you'll want get_objstorage(cls, args)). The keyword argument could have a shorter name too. How about objstorages?

olasd requested changes to this revision.Jul 27 2016, 4:41 PM
olasd edited edge metadata.
This revision now requires changes to proceed.Jul 27 2016, 4:41 PM
qcampos edited edge metadata.
qcampos marked 2 inline comments as done.
  • Correct ObjStorage filters initialization
  • Update ObjStorages tests so they use the new initialization (this allow to test the initialization), and add specific tests for basic storage initialization.
olasd edited edge metadata.

Thanks!

This revision is now accepted and ready to land.Jul 28 2016, 2:38 PM
This revision was automatically updated to reflect the committed changes.