Use BPTree store
This commit is contained in:
parent
8aab85d925
commit
efe8b133dd
18
METANOIA.go
18
METANOIA.go
|
@ -33,7 +33,7 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var printDb *specializedstore.BadgerStore
|
||||
var printDb *specializedstore.BPTreeFileStore
|
||||
var printStrategy *panako.Strategy
|
||||
var db *database.Database
|
||||
var resourceCreationMutex sync.Mutex
|
||||
|
@ -321,26 +321,12 @@ func main() {
|
|||
}
|
||||
defer db.Close()
|
||||
|
||||
printDb, err = specializedstore.NewBadgerStore(*printDbOption, true, *cmdOption == "query", 100000)
|
||||
printDb, err = specializedstore.NewBPTreeFileStore(*printDbOption, true)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
dbGcTicker := time.NewTicker(15 * time.Minute)
|
||||
go func() {
|
||||
for range dbGcTicker.C {
|
||||
for printDb.RunGarbageCollection() == nil {
|
||||
|
||||
}
|
||||
}
|
||||
}()
|
||||
defer printDb.Close()
|
||||
defer func() {
|
||||
for printDb.RunGarbageCollection() == nil {
|
||||
|
||||
}
|
||||
}()
|
||||
defer dbGcTicker.Stop()
|
||||
|
||||
//TODO: check if mutex is correct!
|
||||
printStrategy = panako.NewStrategy(printDb, true)
|
||||
|
|
Loading…
Reference in a new issue