*: make backend outside kv

KV and lease will share the same backend. Thus we need to make
backend outside KV.
This commit is contained in:
Xiang Li
2016-01-05 19:45:18 -08:00
parent 1e61243fd7
commit 5dd3f91903
18 changed files with 204 additions and 132 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
"github.com/coreos/etcd/storage"
"github.com/coreos/etcd/storage/backend"
)
var (
@@ -30,7 +31,8 @@ var (
)
func initStorage() {
s = storage.NewStore("storage-bench", time.Duration(batchInterval), batchLimit)
be := backend.New("storage-bench", time.Duration(batchInterval), batchLimit)
s = storage.NewStore(be)
os.Remove("storage-bench") // boltDB has an opened fd, so removing the file is ok
}