8 Commits

Author SHA1 Message Date
Yicheng Qin
4b9b0cbcc1 storage: add newBackend and newBatchTx
This is for ease of testing.
2015-08-31 13:25:10 -07:00
Yicheng Qin
054fab84ee storage/backend: remove startc var
This makes start logic cleaner.
2015-08-28 13:52:31 -07:00
Xiang Li
e8f40b0412 storage/backend: add commitAndStop
After the upgrade of boltdb, db.Close waits for all txn to finish.
CommitAndStop commits the current txn and stop creating new ones.
2015-08-25 10:57:25 -07:00
Xiang Li
53a77fa519 *: tnx -> txn 2015-07-24 23:21:09 +08:00
Xiang Li
ba9a46aa02 storage: initial snapshot and restore
Snapshot takes an io.Writer and writes the entire backend data to
the given writer. Snapshot writes a consistent view and does not
block other storage operations.

Restore restores the in-memory states (index and book keeping) of
the storage from the backend data.
2015-06-10 11:32:10 -07:00
Xiang Li
49da7b6556 storage: add boltdb as dependency 2015-05-27 09:24:49 -07:00
Xiang Li
e332e86b5d storage: address barak's comments 2015-05-20 17:47:35 -07:00
Xiang Li
4b0d9f69c7 storage: add a simple backend and kv example 2015-05-14 20:43:32 -07:00