Interface IWritingChunkCache
Caches chunks during write operations.
public interface IWritingChunkCache
Methods
Flush(Action<ulong, Memory<byte>>)
Flushes the chunk.
void Flush(Action<ulong, Memory<byte>> chunkWriter)
Parameters
chunkWriterAction<ulong, Memory<byte>>The chunk writer used for chunks being flushed from the cache.
GetChunk(ulong, Func<Memory<byte>>, Action<ulong, Memory<byte>>)
Tries to get the chunk at the given index.
Memory<byte> GetChunk(ulong chunkIndex, Func<Memory<byte>> chunkAllocator, Action<ulong, Memory<byte>> chunkWriter)
Parameters
chunkIndexulongThe linear chunk index.
chunkAllocatorFunc<Memory<byte>>The chunk allocator is used whenever the chunk is not already cached.
chunkWriterAction<ulong, Memory<byte>>The chunk writer is used whenever the chunk is flushed from the cache.