aiidateam / disk-objectstore

An implementation of an efficient "object store" (actually, a key-value store) writing files on disk and not requiring a running server
https://disk-objectstore.readthedocs.io
MIT License
15 stars 8 forks source link

Implement option to rewind and avoid leaving 'holes' when writing directly to pack #85

Closed giovannipizzi closed 4 years ago

giovannipizzi commented 4 years ago

I would make it as an option, but in many cases (e.g. during export) you know you don't risk to write the same object over and over so it's ok. Also, it should truncate the pack at the end if the last bytes are not referenced.

giovannipizzi commented 4 years ago

Note: this should not be needed for the pack_all_loose method, because it first checks which new objects to add, and if the object does not match the hash key (and validate_objects is True) an exception is raised