Page MenuHomeSoftware Heritage

Storage.content_find should return all matches, not just one.
Closed, ResolvedPublic

Description

(from https://forge.softwareheritage.org/D645?id=1994#inline-3203 )

The content_find method of the storage API takes as argument a dictionary whose keys are names of hash algorithms and values are digests for these hashes.
It then looks at all content blobs in the archive, and looks for blobs whose hashes match *all* the ones provided.

Most of the time, there are only 0 or 1, and it returns it (if any).
But there may be more than 1 in case of hash collisions, and we need to handle that (this is partly why we support more than one hash algorithm).

Therefore, this function should be modified to return a *list* of contents instead of a single one. It is implemented both in swh/storage/storage.py (postgresql backend of the storage) and swh/storage/in_memory.py (in-memory backend, used for tests).
Its tests and other functions using this one should be updated as well.

Event Timeline

vlorentz triaged this task as Normal priority.
vlorentz updated the task description. (Show Details)Feb 27 2019, 9:28 PM
vlorentz added a project: Easy hack.
Sowmya added a subscriber: Sowmya.Mar 9 2019, 4:00 AM
Sowmya added a comment.Mar 9 2019, 4:08 AM

can I get this task assigned by the administrator?

zack added a subscriber: zack.Mar 9 2019, 7:47 AM
In T1349#29267, @Sowmya wrote:

can I get this task assigned by the administrator?

There is no need. First, any registered user can modify any task, including this one. Second, there is no need to assign the task to you: just submit a patch and, when it's ready, we'll review it, closing this task when it's done :-)

Ok sir thank you so much. Also can you please provide information regarding how to contact the mentors regarding the mentioned GSOC projects ?

zack added a comment.Mar 11 2019, 5:57 PM

Contact information are available on our GSoC wiki page (which is in turn linked from the GSoC portal).

faux closed this task as Resolved.May 21 2019, 9:53 AM
faux claimed this task.