Move iterators into separate package

Also reduce API exposure and use standard library more - and fix bugs I
previously introduces in mongo.
This commit is contained in:
kortschak 2014-06-30 22:22:50 +09:30
parent 88be6bee37
commit 1768e593a8
62 changed files with 3240 additions and 3130 deletions

View file

@ -19,25 +19,26 @@ import (
"fmt"
"strings"
"github.com/syndtr/goleveldb/leveldb/iterator"
ldbit "github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/google/cayley/graph"
"github.com/google/cayley/graph/iterator"
)
type AllIterator struct {
graph.BaseIterator
iterator.Base
prefix []byte
dir graph.Direction
open bool
it iterator.Iterator
it ldbit.Iterator
ts *TripleStore
ro *opt.ReadOptions
}
func NewAllIterator(prefix string, d graph.Direction, ts *TripleStore) *AllIterator {
var it AllIterator
graph.BaseIteratorInit(&it.BaseIterator)
iterator.BaseInit(&it.Base)
it.ro = &opt.ReadOptions{}
it.ro.DontFillCache = true
it.it = ts.db.NewIterator(nil, it.ro)