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