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
16 stars 8 forks source link

Add `has_object` and `has_objects` methods #47

Closed giovannipizzi closed 4 years ago

giovannipizzi commented 4 years ago

The bulk method is provided for efficiency reasons, and the has_object method for convenience.

The bulk operation reuses the internal methods, at the cost of opening the files one by one. By using the internal methods, however, at least packed files are opened only once per pack file.

Added a performance test, and we will improve performance later (e.g. at least not opening the loose ones).

Fixes #45

Co-authored-by: Sebastiaan Huber sebastiaan.huber@epfl.ch

(since I'm using part of his original implementation of the test)

Replaces #46, so it closes #46 when merged

codecov[bot] commented 4 years ago

Codecov Report

Merging #47 into develop will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop       #47   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          863       871    +8     
=========================================
+ Hits           863       871    +8     
Impacted Files Coverage Δ
disk_objectstore/container.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0f55bed...98fa8f1. Read the comment docs.