github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/storage/chunkDataPacks.go (about)

     1  package storage
     2  
     3  import (
     4  	"github.com/onflow/flow-go/model/flow"
     5  )
     6  
     7  // ChunkDataPacks represents persistent storage for chunk data packs.
     8  type ChunkDataPacks interface {
     9  
    10  	// Store stores multiple ChunkDataPacks cs keyed by their ChunkIDs in a batch.
    11  	// No errors are expected during normal operation, but it may return generic error
    12  	Store(cs []*flow.ChunkDataPack) error
    13  
    14  	// Remove removes multiple ChunkDataPacks cs keyed by their ChunkIDs in a batch.
    15  	// No errors are expected during normal operation, but it may return generic error
    16  	Remove(cs []flow.Identifier) error
    17  
    18  	// BatchStore inserts the chunk header, keyed by chunk ID into a given batch
    19  	BatchStore(c *flow.ChunkDataPack, batch BatchStorage) error
    20  
    21  	// ByChunkID returns the chunk data for the given a chunk ID.
    22  	ByChunkID(chunkID flow.Identifier) (*flow.ChunkDataPack, error)
    23  
    24  	// BatchRemove removes ChunkDataPack c keyed by its ChunkID in provided batch
    25  	// No errors are expected during normal operation, even if no entries are matched.
    26  	// If Badger unexpectedly fails to process the request, the error is wrapped in a generic error and returned.
    27  	BatchRemove(chunkID flow.Identifier, batch BatchStorage) error
    28  }