spanmanager

package
v0.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSpanNotAvailable    = errors.New("span not available in cache")
	ErrIncorrectSpanDigest = errors.New("span digests do not match")
	ErrExceedMaxSpan       = errors.New("span id larger than max span id")
	ErrIncorrectMaxSpanID  = errors.New("given max span ID differs from calculated max span ID")
)

Specific error types raised by SpanManager.

Functions

This section is empty.

Types

type SpanManager

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

SpanManager fetches and caches spans of a given layer.

func New

func New(ztoc *ztoc.Ztoc, r *io.SectionReader, cache cache.BlobCache, retries int, cacheOpt ...cache.Option) (*SpanManager, error)

func (*SpanManager) Close

func (m *SpanManager) Close()

Close closes both the underlying zinfo data and blob cache.

func (*SpanManager) FetchSingleSpan

func (m *SpanManager) FetchSingleSpan(spanID compression.SpanID) error

FetchSingleSpan invokes the reader to fetch the span in the background and cache the span without uncompressing. It is invoked by the BackgroundFetcher. span state change: unrequested -> requested -> fetched.

func (*SpanManager) GetContents

func (m *SpanManager) GetContents(startUncompOffset, endUncompOffset compression.Offset) (io.ReadCloser, error)

GetContents returns a reader for the requested contents. The contents may be across multiple spans.

func (*SpanManager) ResolveSpan

func (m *SpanManager) ResolveSpan(spanID compression.SpanID) error

ResolveSpan ensures the span exists in cache and is uncompressed by using a safer approach that directly fetches and caches the span without calling getSpanContent.

Jump to

Keyboard shortcuts

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