kv

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OptNoBloom = "no_bloom"
)

Variables

View Source
var (
	ErrNoBucket  = errors.New("kv: no bucket")
	ErrEmptyPath = errors.New("kv: path to the database must be specified")
)
View Source
var (
	DefaultQuadIndexes = []QuadIndex{

		{Dirs: []quad.Direction{quad.Subject, quad.Predicate}},

		{Dirs: []quad.Direction{quad.Object, quad.Predicate, quad.Subject}},
	}
)

Functions

func Init

func Init(kv kv.KV, opt graph.Options) error

func New

func New(kv kv.KV, opt graph.Options) (graph.QuadStore, error)

func Register

func Register(name string, r Registration)

Types

type IndexScan

type IndexScan struct {
	Index  QuadIndex
	Values []uint64
}

func (IndexScan) BuildIterator

func (s IndexScan) BuildIterator(qs graph.QuadStore) iterator.Shape

func (IndexScan) Optimize

func (s IndexScan) Optimize(ctx context.Context, r shape.Optimizer) (shape.Shape, bool)

type InitFunc

type InitFunc func(string, graph.Options) (kv.KV, error)

type Int64Set

type Int64Set []uint64

func (Int64Set) Len

func (a Int64Set) Len() int

func (Int64Set) Less

func (a Int64Set) Less(i, j int) bool

func (Int64Set) Swap

func (a Int64Set) Swap(i, j int)

type Int64Value

type Int64Value uint64

func (Int64Value) Key

func (v Int64Value) Key() interface{}

type NewFunc

type NewFunc func(string, graph.Options) (kv.KV, error)

type QuadIndex

type QuadIndex struct {
	Dirs   []quad.Direction `json:"dirs"`
	Unique bool             `json:"unique"`
}

func (QuadIndex) Key

func (ind QuadIndex) Key(vals []uint64) kv.Key

func (QuadIndex) KeyFor

func (ind QuadIndex) KeyFor(p *proto.Primitive) kv.Key

type QuadIterator

type QuadIterator struct {
	// contains filtered or unexported fields
}

func (*QuadIterator) Iterate

func (it *QuadIterator) Iterate() iterator.Scanner

func (*QuadIterator) Lookup

func (it *QuadIterator) Lookup() iterator.Index

func (*QuadIterator) Optimize

func (it *QuadIterator) Optimize(ctx context.Context) (iterator.Shape, bool)

func (*QuadIterator) Sorted

func (it *QuadIterator) Sorted() bool

func (*QuadIterator) Stats

func (it *QuadIterator) Stats(ctx context.Context) (iterator.Costs, error)

func (*QuadIterator) String

func (it *QuadIterator) String() string

func (*QuadIterator) SubIterators

func (it *QuadIterator) SubIterators() []iterator.Shape

type QuadStore

type QuadStore struct {
	// contains filtered or unexported fields
}

func (*QuadStore) ApplyDeltas

func (qs *QuadStore) ApplyDeltas(in []graph.Delta, ignoreOpts graph.IgnoreOpts) error

func (*QuadStore) Close

func (qs *QuadStore) Close() error

func (*QuadStore) NameOf

func (qs *QuadStore) NameOf(v graph.Ref) (quad.Value, error)

func (*QuadStore) NewQuadWriter

func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error)

func (*QuadStore) NodesAllIterator

func (qs *QuadStore) NodesAllIterator() iterator.Shape

func (*QuadStore) OptimizeShape

func (qs *QuadStore) OptimizeShape(ctx context.Context, s shape.Shape) (shape.Shape, bool)

func (*QuadStore) Quad

func (qs *QuadStore) Quad(k graph.Ref) (quad.Quad, error)

func (*QuadStore) QuadDirection

func (qs *QuadStore) QuadDirection(val graph.Ref, d quad.Direction) (graph.Ref, error)

func (*QuadStore) QuadIterator

func (qs *QuadStore) QuadIterator(dir quad.Direction, v graph.Ref) iterator.Shape

func (*QuadStore) QuadIteratorSize

func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Direction, v graph.Ref) (refs.Size, error)

func (*QuadStore) QuadsAllIterator

func (qs *QuadStore) QuadsAllIterator() iterator.Shape

func (*QuadStore) RefsOf

func (qs *QuadStore) RefsOf(ctx context.Context, nodes []quad.Value) ([]graph.Ref, error)

func (*QuadStore) Size

func (qs *QuadStore) Size() int64

func (*QuadStore) Stats

func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Stats, error)

func (*QuadStore) ValueOf

func (qs *QuadStore) ValueOf(s quad.Value) (graph.Ref, error)

func (*QuadStore) ValuesOf

func (qs *QuadStore) ValuesOf(ctx context.Context, vals []graph.Ref) ([]quad.Value, error)

type Registration

type Registration struct {
	NewFunc      NewFunc
	InitFunc     InitFunc
	IsPersistent bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL