0
0

Add compact method to goleveldb store

This commit is contained in:
Mark Mindenhall 2016-05-17 16:58:17 -06:00
parent c6666d4674
commit 3aa1d72233

View File

@ -16,6 +16,7 @@ import (
"github.com/blevesearch/bleve/registry"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/syndtr/goleveldb/leveldb/util"
)
const Name = "goleveldb"
@ -77,6 +78,10 @@ func (ldbs *Store) Writer() (store.KVWriter, error) {
}, nil
}
func (ldbs *Store) Compact() error {
return ldbs.db.CompactRange(util.Range{nil, nil})
}
func init() {
registry.RegisterKVStore(Name, New)
}