Description:
add boltdb implement for db interface.
The boltdb is safe and high performence embedded KV database. It is based on B+tree and Mmap.
Now it is maintained by etcd-io org. https://github.com/etcd-io/bbolt
It is much better than LSM tree (levelDB) when RANDOM and SCAN read.
Replaced #3604
Refs #1835
Commits:
* add boltdb for storage
* update boltdb in gopkg.toml
* update bbolt in Gopkg.lock
* dep update Gopkg.lock
* add boltdb'bucket when create Boltdb
* some modifies
* address my own comments
* fix most of the Iterator tests for boltdb
* bolt does not support concurrent writes while iterating
* add WARNING word
* note that ReadOnly option is not supported
* fixes after Ismail's review
Co-Authored-By: melekes <anton.kalyaev@gmail.com>
* panic if View returns error
plus specify bucket in the top comment
* Enforce file permissions in case they've changed
* test behaviour for autofile
* use testify in tests and rename `fInf` to `fileInfo`
* return an error if file permissions have changed
- if we can't read the file, we'll still panic
* get rid of "github.com/pkg/errors" dependency
* address review comments:
- prefix instead of suffix
- add state to err and construct formatting in Error() method
* address review comments:
- move error to libs/errors
+ *FSDB.HasKey now uses common.FileExists to test for file existence
+ IsKeyInDomain takes key as a []byte slice instead of as a string
to avoid extraneous []byte<-->string conversions for start and end
+ Iterator.Close() instead of Iterator.Release()
+ withDB helper to encapsulate DB creation, deferred cleanups
so that for loops can use opened DBs and discard them ASAP
Addressing accepted changes from review with @jaekwon
* Add CacheDB & SimpleMap
* Generic memBatch; Fix cLevelDB tests
* CacheWrap() for CacheDB and MemDB
* Change Iterator to match LeviGo Iterator
* Fixes from review
* cacheWrapWriteMutex and some race fixes
* Use tmlibs/common
* NewCWWMutex is exposed. DB can be CacheWrap'd
* Remove GetOK, not needed
* Fsdb (#72)
* Add FSDB
* Review fixes from Anton
* Review changes
* Fixes from review