From f2cc5f5fd9c45835301874506a53fcf36f999bd5 Mon Sep 17 00:00:00 2001 From: siddontang Date: Fri, 12 Dec 2014 20:56:17 +0800 Subject: [PATCH] use newest goleveldb you must update goleveldb by yourself --- Godeps/Godeps.json | 6 +++--- store/goleveldb/db.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 5aae124..cd2c5bf 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -11,8 +11,8 @@ }, { "ImportPath": "github.com/boltdb/bolt", - "Comment": "data/v1-256-ge65c902", - "Rev": "e65c9027c35b7ef1014db9e02686889e51aadb2e" + "Comment": "v1.0-5-g33e7a07", + "Rev": "33e7a074e2c470b6d0b7ee23322a1c4cc759044b" }, { "ImportPath": "github.com/cupcake/rdb", @@ -60,7 +60,7 @@ }, { "ImportPath": "github.com/syndtr/goleveldb/leveldb", - "Rev": "c9e0ae706141dc099005d6d247e4880c7feda2e1" + "Rev": "63c9e642efad852f49e20a6f90194cae112fd2ac" }, { "ImportPath": "github.com/syndtr/gosnappy/snappy", diff --git a/store/goleveldb/db.go b/store/goleveldb/db.go index af8633b..88d2516 100644 --- a/store/goleveldb/db.go +++ b/store/goleveldb/db.go @@ -113,7 +113,7 @@ func newOptions(cfg *config.LevelDBConfig) *opt.Options { opts := &opt.Options{} opts.ErrorIfMissing = false - opts.BlockCache = cache.NewLRUCache(cfg.CacheSize) + opts.BlockCacheCapacity = cfg.CacheSize //we must use bloomfilter opts.Filter = filter.NewBloomFilter(defaultFilterBits) @@ -126,7 +126,7 @@ func newOptions(cfg *config.LevelDBConfig) *opt.Options { opts.BlockSize = cfg.BlockSize opts.WriteBuffer = cfg.WriteBufferSize - opts.CachedOpenFiles = cfg.MaxOpenFiles + opts.OpenFilesCacheCapacity = cfg.MaxOpenFiles //here we use default value, later add config support opts.CompactionTableSize = 32 * 1024 * 1024