- 20 Mar, 2019 2 commits
-
-
Steven Allen authored
-
Steven Allen authored
-
- 15 Mar, 2019 1 commit
-
-
Steven Allen authored
It's a lie! We: 1. Assume that our datastores are thread-safe all over the place, not bothering to check for this interface. 2. Implement this interface for, e.g., the mount datastore that _may not_ be thread-safe (depending on the sub-datastores). Basically, there's no sane way to to do something like this in go. What we _want_ is: ```rust pub trait ThreadSafe {} struct MyWrapper<D: Datastore> { ... } impl<D: Datastore> ThreadSafe for MyWrapper<D> where D: ThreadSafe {} ``` Actually, we don't even need this because rust has already done all the hard work with the `Sync` trait. .... But we're using go which barely has types. --- For completeness, it's actually possible to do this in go: ```go type threadSafeMixin struct{} func (threadSafeMixin) ThreadSafe() {} func NewWrapper(d Datastore) Datastore { if _, ok := d.(ThreadSafe) { return &struct{myWrapper, threadSafeMixin}{myWrapper{d}, threadSafeMixin{}} } return &myWrapper{d} } ``` Let's not.
-
- 28 Jan, 2019 1 commit
-
-
Steven Allen authored
We no longer need them.
-
- 04 Oct, 2018 1 commit
-
-
Steven Allen authored
We can also add this as an extension but it's simple enough I'd like to add it directly to the Datastore. Use-case: The blockstore now has a GetSize and bitswap uses it for packing multiple blocks into a single message. Unfortunately, this means that bitswap is now calling blockstore.GetSize which calls datastore.Get which tends to be more expensive than datastore.Has.
-
- 13 Aug, 2018 1 commit
-
-
Steven Allen authored
None of our actual datastores support any other types and the cast noise gets really annoying after a while.
-
- 26 Jan, 2018 1 commit
-
-
Łukasz Magiera authored
-
- 24 Jan, 2018 1 commit
-
-
Hector Sanjuan authored
This adds a PersistentDatastore interface which allows datastores to report DiskUsage(). It implementes the interface on all wrapper types, which return 0 if the wrapped datastore does not provide this method. Related: https://github.com/ipfs/go-ipfs/pull/4550
-
- 23 Jan, 2018 1 commit
-
-
Łukasz Magiera authored
-
- 14 Oct, 2017 1 commit
-
-
Łukasz Magiera authored
-
- 03 Jul, 2017 1 commit
-
-
Łukasz Magiera authored
-
- 28 Jun, 2017 1 commit
-
-
Łukasz Magiera authored
-
- 27 Jun, 2017 1 commit
-
-
Łukasz Magiera authored
-
- 01 Jan, 2016 1 commit
-
-
Jeromy authored
-
- 17 Jul, 2015 1 commit
-
-
Jeromy authored
-
- 16 Jul, 2015 1 commit
-
-
Jeromy authored
-
- 02 Jul, 2015 1 commit
-
-
Jeromy authored
implement batch ops for different datastore types rename Transaction to Batch Revert "add in support for batched writes" add in benchmarks for put and batchput move batching into separate interface address concerns from PR regrab old code
-
- 27 Jun, 2015 1 commit
-
-
Juan Batiz-Benet authored
-
- 26 Jun, 2015 2 commits
- 16 Mar, 2015 4 commits
-
-
Tommi Virtanen authored
-
Tommi Virtanen authored
-
Tommi Virtanen authored
-
Tommi Virtanen authored
-