Datastore based pinner (#4)
feat: store pins in datastore instead of a DAG Adds a new `/pins` namespace to the given datastore and uses that to store pins as cbor binary, keyed by unique pin ID. The new datastore pinner stores pins in the datastore as individual key-value items. This is faster than the dag pinner, which stored all pins in a single dag that had to be rewritten every time a pin was added or removed. The new pinner provides a secondary indexing mechanism that can be used to index any data that a pin has. Secondary indexing logic is provided by the `dsindex` package. The new pinner currently includes indexing by CID. Both the new datastore pinner (`dspinner` package) and the old dag pinner (`ipldpinner` package) implementations are included to support migration between the two. Migration logic is provided by the `pinconv` package. Other features in new pinner: - Benchmarks are provided to compare performance of between the old and new pinners - New pinner does not keep in-memory set of pinned CIDs, instead it relies on the datastore - Separate recursive and direct CID indexes allow searching for pins without having to load pin data to check the mode - New pinner can rebuild indexes on load, if saved pins appear out of sync with the indexes
Showing
.gitignore
0 → 100644
dsindex/error.go
0 → 100644
dsindex/indexer.go
0 → 100644
dsindex/indexer_test.go
0 → 100644
dspinner/pin.go
0 → 100644
This diff is collapsed.
dspinner/pin_test.go
0 → 100644
This diff is collapsed.
... | ... | @@ -4,13 +4,16 @@ go 1.13 |
require ( | ||
github.com/gogo/protobuf v1.3.1 | ||
github.com/ipfs/go-blockservice v0.1.2 | ||
github.com/ipfs/go-cid v0.0.3 | ||
github.com/ipfs/go-datastore v0.3.0 | ||
github.com/ipfs/go-ipfs-blockstore v0.1.0 | ||
github.com/ipfs/go-blockservice v0.1.4 | ||
github.com/ipfs/go-cid v0.0.7 | ||
github.com/ipfs/go-datastore v0.4.5 | ||
github.com/ipfs/go-ds-leveldb v0.4.2 | ||
github.com/ipfs/go-ipfs-blockstore v0.1.4 | ||
github.com/ipfs/go-ipfs-exchange-offline v0.0.1 | ||
github.com/ipfs/go-ipfs-util v0.0.1 | ||
github.com/ipfs/go-ipld-format v0.0.2 | ||
github.com/ipfs/go-log v0.0.1 | ||
github.com/ipfs/go-ipfs-util v0.0.2 | ||
github.com/ipfs/go-ipld-format v0.2.0 | ||
github.com/ipfs/go-log v1.0.4 | ||
github.com/ipfs/go-merkledag v0.3.0 | ||
github.com/multiformats/go-multibase v0.0.3 | ||
github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1 | ||
) |
This diff is collapsed.
ipldpinner/pin.go
0 → 100644
pinconv/pinconv.go
0 → 100644
pinconv/pinconv_test.go
0 → 100644
Please register or sign in to comment