func (b *BpTree) Range(from, to *subgraph.SubGraph) (it Iterator, err error) { b.mutex.Lock() defer b.mutex.Unlock() raw, err := b.bpt.Range(subgraph_embedding.SerializeSubGraph(from), subgraph_embedding.SerializeSubGraph(to)) if err != nil { return nil, err } return b.kvIter(raw), nil }
func (b *BpTree) Remove(key *subgraph.SubGraph, where func([]map[int]bool) bool) error { b.mutex.Lock() defer b.mutex.Unlock() return b.bpt.Remove(subgraph_embedding.SerializeSubGraph(key), func(bytes []byte) bool { return where(DeserializeOverlap(bytes)) }) }
func (b *BpTree) Find(key *subgraph.SubGraph) (it Iterator, err error) { b.mutex.Lock() defer b.mutex.Unlock() raw, err := b.bpt.Find(subgraph_embedding.SerializeSubGraph(key)) if err != nil { return nil, err } return b.kvIter(raw), nil }
func (b *BpTree) Has(key *subgraph.SubGraph) (bool, error) { b.mutex.Lock() defer b.mutex.Unlock() return b.bpt.Has(subgraph_embedding.SerializeSubGraph(key)) }
func (b *BpTree) Count(key *subgraph.SubGraph) (int, error) { b.mutex.Lock() defer b.mutex.Unlock() return b.bpt.Count(subgraph_embedding.SerializeSubGraph(key)) }
func (b *BpTree) Add(key *subgraph.SubGraph, val []map[int]bool) error { b.mutex.Lock() defer b.mutex.Unlock() return b.bpt.Add(subgraph_embedding.SerializeSubGraph(key), SerializeOverlap(val)) }