MCPcopy Create free account
hub / github.com/perkeep/perkeep / LoadAllChunks

Method LoadAllChunks

pkg/schema/filereader.go:126–131  ·  view source on GitHub ↗

LoadAllChunks starts a process of loading all chunks of this file as quickly as possible. The contents are immediately discarded, so it is assumed that the fetcher is a caching fetcher.

()

Source from the content-addressed store, hash-verified

124// as quickly as possible. The contents are immediately discarded, so
125// it is assumed that the fetcher is a caching fetcher.
126func (fr *FileReader) LoadAllChunks() {
127 // TODO: ask the underlying blobserver to do this if it would
128 // prefer. Some blobservers (like blobpacked) might not want
129 // to do this at all.
130 go fr.loadAllChunksSync(context.Background())
131}
132
133func (fr *FileReader) loadAllChunksSync(ctx context.Context) {
134 gate := syncutil.NewGate(20) // num readahead chunk loads at a time

Callers 2

smartFetchFunction · 0.95
mainFunction · 0.80

Calls 1

loadAllChunksSyncMethod · 0.95

Tested by

no test coverage detected