vcache

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(engine storage.Engine) *Cache

func (*Cache) Fetch

func (c *Cache) Fetch(ctx context.Context, uri *storage.URI, id ksuid.KSUID) (*Object, error)

type Fork added in v1.13.0

type Fork []Path

type Object

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

Object is the interface to load a given VNG object from storage into memory and perform projections (or whole value reads) of the in-memory data. This is also suitable for one-pass use where the data is read on demand, used for processing, then discarded. Objects maybe be persisted across multiple callers of Cache and the zed.Context in use is passed in for each vector constructed from its in-memory shadow.

func NewObject

func NewObject(ctx context.Context, engine storage.Engine, uri *storage.URI) (*Object, error)

NewObject creates a new in-memory Object corresponding to a VNG object residing in storage. The VNG header and metadata section are read and the metadata is deserialized so that vectors can be loaded into the cache on demand only as needed and retained in memory for future use.

func (*Object) Close

func (o *Object) Close() error

func (*Object) Fetch added in v1.13.0

func (o *Object) Fetch(zctx *zed.Context, projection Path) (vector.Any, error)

Fetch returns the indicated projection of data in this VNG object. If any required data is not memory resident, it will be fetched from storage and cached in memory so that subsequent calls run from memory. The vectors returned will have types from the provided zctx. Multiple Fetch calls to the same object may run concurrently.

type Path added in v1.13.0

type Path []any //XXX clean this up later

A path is an array of string or Forks

func NewProjection

func NewProjection(paths []field.Path) Path

Jump to

Keyboard shortcuts

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