Skip to content

Commit

Permalink
complete mods to deprecate basholeveldb as default
Browse files Browse the repository at this point in the history
  • Loading branch information
DocSavage committed May 5, 2024
1 parent db1e95c commit b07e713
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 39 deletions.
6 changes: 3 additions & 3 deletions README-precomputed.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ max_log_age = 30
[store]
[store.mainstore]
engine = "basholeveldb"
path = "/data/dvid/db/leveldb"
engine = "badger"
path = "/data/dvid/db/mydb"
[store.mutationlog]
engine = "filelog"
path = "/data/dvid/db/mlog-leveldb"
path = "/data/dvid/db/mutationlog"
[store.mystorage]
engine = "ngprecomputed"
Expand Down
8 changes: 4 additions & 4 deletions conf/config.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ webClient = "/console"

[backend]
[backend.default]
store = "mutable"
log = "mutationlog"
store = "mutable"
log = "mutationlog"
[store]
[store.mutable]
engine = "basholeveldb"
path = "/data/dbs/dataset"
engine = "badger"
path = "/data/dbs/dataset"
6 changes: 5 additions & 1 deletion datastore/badger.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//go:build badger
// +build badger

package datastore

import _ "github.com/janelia-flyem/dvid/storage/badger"
import (
_ "github.com/janelia-flyem/dvid/storage/badger"
_ "github.com/janelia-flyem/dvid/storage/filelog"
)
7 changes: 5 additions & 2 deletions datastore/basholeveldb.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//go:build basholeveldb
// +build basholeveldb

package datastore

import _ "github.com/janelia-flyem/dvid/storage/basholeveldb"
import _ "github.com/janelia-flyem/dvid/storage/filelog"
import (
_ "github.com/janelia-flyem/dvid/storage/basholeveldb"
_ "github.com/janelia-flyem/dvid/storage/filelog"
)
2 changes: 1 addition & 1 deletion datastore/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func openStores(create bool, datamap ...DataStorageMap) {
if len(datamap) > 1 {
log.Fatalf("can't have more than one data mapping in opening stores")
}
dvid.Infof("Opening test datastore. Create = %v\n", create)
dvid.Infof("Opening test datastore. Create (%t), Datamap: %v\n", create, datamap)
if create {
var err error
if len(datamap) == 1 {
Expand Down
2 changes: 1 addition & 1 deletion datatype/imageblk/imageblk.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func NewType(values dvid.DataValues, interpolable bool) Type {

// NewData returns a pointer to a new Voxels with default values.
func (dtype *Type) NewData(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (*Data, error) {
dvid.Infof("NewData on name %q\n", name)
dvid.Infof("NewData on imageblk name %q with config: %v\n", name, c)
basedata, err := datastore.NewDataService(dtype, uuid, id, name, c)
if err != nil {
return nil, err
Expand Down
9 changes: 0 additions & 9 deletions datatype/tarsupervoxels/basholeveldb_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion dvid/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type AutoInstanceStore interface {
type StoreConfig struct {
Config

// Engine is a simple name describing the engine, e.g., "basholeveldb"
// Engine is a simple name describing the engine, e.g., "badger"
Engine string
}

Expand Down
8 changes: 4 additions & 4 deletions scripts/distro-files/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ blobstore = "raid6"

[store]
[store.raid6]
engine = "basholeveldb"
path = "/data/dbs/basholeveldb"
engine = "badger"
path = "/data/dbs/badgerdb"

[store.ssd]
engine = "basholeveldb"
path = "/datassd/dbs/basholeveldb"
engine = "badger"
path = "/datassd/dbs/badgerdb"

[store.badger]
engine = "badger"
Expand Down
4 changes: 2 additions & 2 deletions scripts/distro-files/config-simple.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ max_log_age = 30 # days

[store]
[store.instancedata]
engine = "basholeveldb"
path = "/tmp/basholeveldb"
engine = "badger"
path = "/tmp/badgerdb"

[store.mutationlog]
engine = "filelog"
Expand Down
4 changes: 2 additions & 2 deletions server/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ EXPERIMENTAL COMMANDS
"SrcStore": "source store",
"DstStore": {
"Path": "/path/to/store",
"Engine": "basholeveldb"
"Engine": "badger"
}
},
{
Expand Down Expand Up @@ -157,7 +157,7 @@ EXPERIMENTAL COMMANDS
"Versions": ["2881e9","52a13","57e8d"],
"Exclusions": ["name1", "name2"],
"DstStore": {
"Engine": "basholeveldb",
"Engine": "badger",
"Path": "/path/to/new/metadata_db"
},
"Alias": "my new repo alias",
Expand Down
6 changes: 3 additions & 3 deletions server/server_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ func TestTOMLConfigAbsolutePath(t *testing.T) {
c.Store = make(map[storage.Alias]storeConfig)

c.Store["foo"] = make(storeConfig)
c.Store["foo"]["engine"] = "basholeveldb"
c.Store["foo"]["engine"] = "badger"
c.Store["foo"]["path"] = "foo-storage-db"

c.Store["bar"] = make(storeConfig)
c.Store["bar"]["engine"] = "basholeveldb"
c.Store["bar"]["engine"] = "badger"
c.Store["bar"]["path"] = "/tmp/bar-storage-db" // Already absolute, should stay unchanged.

// Convert relative paths to absolute
Expand All @@ -227,7 +227,7 @@ func TestTOMLConfigAbsolutePath(t *testing.T) {
}

engine := foo["engine"]
if engine.(string) != "basholeveldb" {
if engine.(string) != "badger" {
t.Errorf("[store.foo].engine should not have been touched: %s", path)
}

Expand Down
2 changes: 1 addition & 1 deletion storage/badger/badger.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ func (db *BadgerDB) DeleteAll(ctx storage.Context) error {
if err != nil {
return err
}
name = vctx.Data().DataName()
name = string(vctx.Data().DataName())
} else {
minKey, maxKey = ctx.KeyRange()
name = ctx.String()
Expand Down
9 changes: 5 additions & 4 deletions storage/kvautobus/kvautobus_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build kvautobus
// +build kvautobus

package kvautobus
Expand All @@ -15,12 +16,12 @@ import (
const testConfig = `
[store]
[store.raid6]
engine = "basholeveldb"
path = "/data/dbs/basholeveldb"
engine = "badger"
path = "/data/dbs/badgerdb"
[store.ssd]
engine = "basholeveldb"
path = "/datassd/dbs/basholeveldb"
engine = "badger"
path = "/datassd/dbs/badgerdb"
[store.kvautobus]
engine = "kvautobus"
Expand Down
4 changes: 3 additions & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Requirements struct {
type Engine interface {
fmt.Stringer

// GetName returns a simple driver identifier like "basholeveldb", "kvautobus" or "bigtable".
// GetName returns a simple driver identifier like "badger", "kvautobus" or "bigtable".
GetName() string

// IsDistributed returns whether the engine is a distributed DB (engine should manage request throttling)
Expand Down Expand Up @@ -129,13 +129,15 @@ func GetTestableBackend(kvMap, logMap DataMap) (map[Alias]TestableEngine, *Backe
if err != nil {
dvid.Errorf("checking engine %q: %v\n", e, err)
} else {
dvid.Infof("Found testable engine %q with alias %q\n", e, alias)
engines[alias] = tEng
found = true
}
}
}
backend.KVAssign = kvMap
backend.LogAssign = logMap
dvid.Infof("For new testable backend (%v) assigned KV: %v, Log: %v\n", backend, kvMap, logMap)
if !found {
return nil, nil, fmt.Errorf("could not find any testable storage configuration")
}
Expand Down

0 comments on commit b07e713

Please sign in to comment.