MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / Discard

Method Discard

statesync/chunks.go:147–151  ·  view source on GitHub ↗

Discard discards a chunk. It will be removed from the queue, available for allocation, and can be added and returned via Next() again. If the chunk is not already in the queue this does nothing, to avoid it being allocated to multiple fetchers.

(index uint32)

Source from the content-addressed store, hash-verified

145// be added and returned via Next() again. If the chunk is not already in the queue this does
146// nothing, to avoid it being allocated to multiple fetchers.
147func (q *chunkQueue) Discard(index uint32) error {
148 q.Lock()
149 defer q.Unlock()
150 return q.discard(index)
151}
152
153// discard discards a chunk, scheduling it for refetching. The caller must hold the mutex lock.
154func (q *chunkQueue) discard(index uint32) error {

Callers 3

TestChunkQueue_AllocateFunction · 0.80
TestChunkQueue_DiscardFunction · 0.80
applyChunksMethod · 0.80

Calls 3

discardMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by 2

TestChunkQueue_AllocateFunction · 0.64
TestChunkQueue_DiscardFunction · 0.64