cache

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package cache provides for caching facts that were infered during a query and pottentially reusing them for subsequent operations with the same query.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FactCache

type FactCache interface {
	// AddFact offers the cache a chance to remember this fact, if it does choose to remember
	// it, it should make a copy
	AddFact(f *rpc.Fact)

	// AddInferedFact offers the cache a change to remember this inferred fact, along with
	// the actual path that was used for the inference
	AddInferedFact(f *rpc.Fact, inferencePath []rpc.Fact)

	// AddFiction offers the cache a chance to remember that the fact <s><p><o> definitely
	// does not exist at the indicated index.
	AddFiction(index uint64, subject, predicate uint64, obj rpc.KGObject)

	// Fact checks to see if there's a fact in the cache with the SPO, and that is known
	// to exist at the index
	Fact(index uint64, subject, predicate uint64, obj rpc.KGObject) (fact *rpc.Fact, inferencePath []rpc.Fact)

	// IsFiction returns true if we know that the fact <s><p><o> does not exist at the
	// log index
	IsFiction(index uint64, subject, predicate uint64, obj rpc.KGObject) bool
}

FactCache allows for code to find and cache facts (most typically inferred facts) to reduce the number of parts of the query that need to be fully executed against the views

func New

func New() FactCache

New returns a new, empty FactCache, it is safe for concurrent use

Jump to

Keyboard shortcuts

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