func NewQuasar(cfg *QuasarConfig) (*Quasar, error) { bs, err := bstore.NewBlockStore(cfg.Params) if err != nil { return nil, err } rv := &Quasar{ cfg: *cfg, bs: bs, openTrees: make(map[[16]byte]*openTree, 128), treelocks: make(map[[16]byte]*sync.Mutex, 128), } return rv, nil }
func mBS() { if _bs == nil { params := map[string]string{ "dbpath": "/srv/quasartestdb/", "mongoserver": "localhost", "cachesize": "5000", } nbs, err := bstore.NewBlockStore(params) if err != nil { log.Panic(err) } _bs = nbs } }