|
@ -34,6 +34,7 @@ type LevelDB3Store struct { |
|
|
dir string |
|
|
dir string |
|
|
dbs map[string]*leveldb.DB |
|
|
dbs map[string]*leveldb.DB |
|
|
dbsLock sync.RWMutex |
|
|
dbsLock sync.RWMutex |
|
|
|
|
|
ReadOnly bool |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (store *LevelDB3Store) GetName() string { |
|
|
func (store *LevelDB3Store) GetName() string { |
|
@ -69,12 +70,14 @@ func (store *LevelDB3Store) loadDB(name string) (*leveldb.DB, error) { |
|
|
BlockCacheCapacity: 32 * 1024 * 1024, // default value is 8MiB
|
|
|
BlockCacheCapacity: 32 * 1024 * 1024, // default value is 8MiB
|
|
|
WriteBuffer: 16 * 1024 * 1024, // default value is 4MiB
|
|
|
WriteBuffer: 16 * 1024 * 1024, // default value is 4MiB
|
|
|
Filter: bloom, |
|
|
Filter: bloom, |
|
|
|
|
|
ReadOnly: store.ReadOnly, |
|
|
} |
|
|
} |
|
|
if name != DEFAULT { |
|
|
if name != DEFAULT { |
|
|
opts = &opt.Options{ |
|
|
opts = &opt.Options{ |
|
|
BlockCacheCapacity: 16 * 1024 * 1024, // default value is 8MiB
|
|
|
BlockCacheCapacity: 16 * 1024 * 1024, // default value is 8MiB
|
|
|
WriteBuffer: 8 * 1024 * 1024, // default value is 4MiB
|
|
|
WriteBuffer: 8 * 1024 * 1024, // default value is 4MiB
|
|
|
Filter: bloom, |
|
|
Filter: bloom, |
|
|
|
|
|
ReadOnly: store.ReadOnly, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|