github.com/koko1123/flow-go-1@v0.29.6/storage/chunkDataPacks.go (about)

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