func NewCompensator() *Compensator { rv := Compensator{ inFlight: gtreap.NewTreap(inFlightItemCompare), deletedDocNumbers: bitset.New(1000000), } return &rv }
func New(mo store.MergeOperator, config map[string]interface{}) (store.KVStore, error) { rv := Store{ t: gtreap.NewTreap(itemCompare), mo: mo, } return &rv, nil }
func StoreConstructor(config map[string]interface{}) (store.KVStore, error) { s := &Store{ availableWriters: make(chan bool, MAX_CONCURRENT_WRITERS), t: gtreap.NewTreap(itemCompare), } for i := 0; i < MAX_CONCURRENT_WRITERS; i++ { s.availableWriters <- true } return s, nil }
func New(mo store.MergeOperator, config map[string]interface{}) (store.KVStore, error) { path, ok := config["path"].(string) if !ok { return nil, fmt.Errorf("must specify path") } if path != "" { return nil, os.ErrInvalid } rv := Store{ t: gtreap.NewTreap(itemCompare), mo: mo, } return &rv, nil }