kv

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptAssumeDefaultIdx = "assume_default_idx"
	OptBloom            = "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 CompareQuadDirections added in v0.9.0

func CompareQuadDirections(a, b []quad.Direction) bool

CompareQuadDirections compares two slices of quad directions for equality.

func CompareQuadIndexes added in v0.9.0

func CompareQuadIndexes(a, b []QuadIndex) bool

CompareQuadIndexes compares two slices of quad indexes for equality.

func Init

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

func New

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

func Register

func Register(name string, r Registration)

Types

type IndexScan added in v0.9.0

type IndexScan struct {
	Index  QuadIndex
	Values []uint64
}

func (IndexScan) BuildIterator added in v0.9.0

func (s IndexScan) BuildIterator(ctx context.Context, qs graph.QuadStore) iterator.Shape

func (IndexScan) Optimize added in v0.9.0

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

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" msgpack:"d"`
	Unique bool             `json:"unique" msgpack:"u"`
}

func (QuadIndex) Equal added in v0.9.0

func (ind QuadIndex) Equal(ot QuadIndex) bool

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 added in v0.9.0

func (it *QuadIterator) Iterate(ctx context.Context) iterator.Scanner

func (*QuadIterator) Lookup added in v0.9.0

func (it *QuadIterator) Lookup(ctx context.Context) iterator.Index

func (*QuadIterator) Optimize

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

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(ctx context.Context, in []graph.Delta, ignoreOpts graph.IgnoreOpts) error

func (*QuadStore) Close

func (qs *QuadStore) Close() error

func (*QuadStore) NameOf

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

func (*QuadStore) NewQuadWriter added in v0.9.0

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

func (*QuadStore) NodesAllIterator

func (qs *QuadStore) NodesAllIterator(ctx context.Context) iterator.Shape

func (*QuadStore) OptimizeShape added in v0.9.0

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

func (*QuadStore) Quad

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

func (*QuadStore) QuadDirection

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

func (*QuadStore) QuadIterator

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

func (*QuadStore) QuadIteratorSize added in v0.9.0

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

func (*QuadStore) QuadsAllIterator

func (qs *QuadStore) QuadsAllIterator(ctx context.Context) iterator.Shape

func (*QuadStore) RefsOf added in v0.7.5

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

func (*QuadStore) Size

func (qs *QuadStore) Size(ctx context.Context) (int64, error)

func (*QuadStore) Stats added in v0.9.0

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

func (*QuadStore) ValueOf

func (qs *QuadStore) ValueOf(ctx context.Context, 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