Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

swarm/chunk, swarm/storage: adjust Store.Put interface to return boolean on chunk exists#1330

Merged
acud merged 3 commits intolocalstore-storage-integrationfrom
chunkstore-interface-put
Apr 9, 2019
Merged

swarm/chunk, swarm/storage: adjust Store.Put interface to return boolean on chunk exists#1330
acud merged 3 commits intolocalstore-storage-integrationfrom
chunkstore-interface-put

Conversation

@acud
Copy link
Copy Markdown
Contributor

@acud acud commented Apr 9, 2019

This PR adds a boolean return value to the Store.Put interface method in order to indicate whether a chunk already exists in the database when doing a Put. This is in order to allow for a correct chunk count when chunking a file.
This will serve as a measure to correctly count added chunks correctly so we could calculate how many chunks a push sync tag has on the fly.
Using this approach we avoid adding the tag vector field in shed.Item and chunk.chunk.

I have adjusted the test that puts duplicate chunks into the database to cover this test. If further tests are needed please do tell.

part of #1019

@acud acud self-assigned this Apr 9, 2019
@acud acud requested review from janos and zelig April 9, 2019 06:11
Copy link
Copy Markdown
Member

@janos janos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very clear and nice.

Comment thread swarm/storage/localstore/mode_put_test.go Outdated
Comment thread swarm/storage/localstore/mode_put_test.go Outdated
Copy link
Copy Markdown
Member

@janos janos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@acud acud merged commit e4d723c into localstore-storage-integration Apr 9, 2019
@acud acud deleted the chunkstore-interface-put branch April 9, 2019 12:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants