Example #1
0
File: comp.go Project: BobbWu/bleve
func NewCompensator() *Compensator {
	rv := Compensator{
		inFlight:          gtreap.NewTreap(inFlightItemCompare),
		deletedDocNumbers: bitset.New(1000000),
	}
	return &rv
}
Example #2
0
func New(mo store.MergeOperator, config map[string]interface{}) (store.KVStore, error) {
	rv := Store{
		t:  gtreap.NewTreap(itemCompare),
		mo: mo,
	}
	return &rv, nil
}
Example #3
0
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
}
Example #4
0
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
}