session

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 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

Overview

Package session owns shared native Lance session lifetimes. The root lance package declares the public Session wrapper and forwards to this package; sibling packages resolve that private state through From without adding a public bridge method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acquire

func Acquire(s *Session) (native *ffi.Session, release func(), ok bool)

Acquire pins s for the duration of one native call. The returned release function must be called after the native call, including on failure. It returns false when s is nil or already closed.

Types

type CacheStats

type CacheStats struct {
	IndexCacheHits         uint64
	IndexCacheMisses       uint64
	IndexCacheEntries      uint64
	IndexCacheSizeBytes    uint64
	MetadataCacheHits      uint64
	MetadataCacheMisses    uint64
	MetadataCacheEntries   uint64
	MetadataCacheSizeBytes uint64
}

CacheStats is a snapshot of both session caches.

type Session

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

Session owns shared index and metadata caches. Datasets and raw file objects opened with a session keep their cache state after the session is closed.

func From added in v0.2.0

func From(owner any) (*Session, bool)

From returns the implementation behind owner. It reports false when owner is not a public root Session wrapper.

func New

func New(native *ffi.Session, wrapError func(op, uri string, err error) error, closedError func(op, uri string) error) *Session

New adopts native and uses the supplied error conversion so callers observe the root package error identities.

func (*Session) ApproxNumItems

func (s *Session) ApproxNumItems() (uint64, error)

ApproxNumItems returns the approximate number of cached items.

func (*Session) CacheStats

func (s *Session) CacheStats() (CacheStats, error)

CacheStats returns a snapshot of the session caches.

func (*Session) Close

func (s *Session) Close() error

Close releases the native session after in-flight calls complete. It is idempotent.

func (*Session) SizeBytes

func (s *Session) SizeBytes() (uint64, error)

SizeBytes returns the approximate cache memory size.

Jump to

Keyboard shortcuts

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