Help us shape the future of Go! Take the 2026 Go Developer Survey

spanmanager

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 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) EnableHotCache

func (m *SpanManager) EnableHotCache(maxEntries int)

EnableHotCache keeps a bounded set of uncompressed spans in memory. It is intended for startup profiles that synchronously pre-resolve a small hot set and then immediately serve many small reads from those same spans.

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.

func (*SpanManager) ResolveSpanRange

func (m *SpanManager) ResolveSpanRange(startUncompOffset, endUncompOffset compression.Offset, maxSpans int) error

Jump to

Keyboard shortcuts

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