vcache

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTypesPerObject = 2500

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

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

func NewConst added in v1.9.0

func NewConst(m *meta.Const) *Const

type Object

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

Object represents the collection of vectors that are loaded into memory for a given data object as referenced by its ID. An Object structure mirrors the metadata structures used in VNG but here we support dynamic loading of vectors as they are needed and data and metadata are all cached in memory.

func NewObject

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

NewObject creates a new in-memory Object corresponding to a VNG object residing in storage. It loads the list of VNG root types (one per value in the file) and the VNG metadata for vector reassembly. A table for each type is also created to map the global slot number in the object to the local slot number in the type so that an element's local position in the vector (within a particular type) can be related to its slot number in the object, e.g., so that filtering of a local vector can be turned into the list of matching object slots. The object provides the metadata needed to load vectors on demand only as they are referenced. A vector is loaded by calling its Load method, which decodes its zcode.Bytes into its native representation. XXX we may want to change the VNG format to code vectors in native format.

func (*Object) Close

func (o *Object) Close() error

func (*Object) Len added in v1.12.0

func (o *Object) Len() int

func (*Object) Load added in v1.12.0

func (o *Object) Load(typeKey uint32, path field.Path) (vector.Any, error)

XXX fix comment Due to the heterogenous nature of Zed data, a given path can appear in multiple types and a given type can have multiple vectors XXX (due to union types in the hiearchy). Load returns a Group for each type and the Group may contain multiple vectors.

func (*Object) LocalContext added in v1.12.0

func (o *Object) LocalContext() *zed.Context

func (*Object) LookupType added in v1.12.0

func (o *Object) LookupType(typeKey uint32) zed.Type

func (*Object) TypeKeys added in v1.12.0

func (o *Object) TypeKeys() []int32

func (*Object) Types added in v1.12.0

func (o *Object) Types() []zed.Type

Jump to

Keyboard shortcuts

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