fetcher

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

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

Fetcher deals with fetching chunk contents from the cache/store, and writing back any misses to the cache. Also responsible for decoding chunks from the cache, in parallel.

func New

func New(cacher cache.Cache, cacheStubs bool, schema config.SchemaConfig, storage client.Client, maxAsyncConcurrency int, maxAsyncBufferSize int) (*Fetcher, error)

New makes a new ChunkFetcher.

func (*Fetcher) Cache

func (c *Fetcher) Cache() cache.Cache

func (*Fetcher) Client

func (c *Fetcher) Client() client.Client

func (*Fetcher) FetchChunks

func (c *Fetcher) FetchChunks(ctx context.Context, chunks []chunk.Chunk, keys []string) ([]chunk.Chunk, error)

FetchChunks fetches a set of chunks from cache and store. Note that the keys passed in must be lexicographically sorted, while the returned chunks are not in the same order as the passed in chunks.

func (*Fetcher) IsChunkNotFoundErr

func (c *Fetcher) IsChunkNotFoundErr(err error) bool

func (*Fetcher) Stop

func (c *Fetcher) Stop()

Stop the ChunkFetcher.

func (*Fetcher) WriteBackCache

func (c *Fetcher) WriteBackCache(ctx context.Context, chunks []chunk.Chunk) error

Jump to

Keyboard shortcuts

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