aboutsummaryrefslogtreecommitdiff
path: root/zenstore/compactcas.h
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-08-23 19:12:14 +0200
committerStefan Boberg <[email protected]>2021-08-23 19:12:14 +0200
commit9497ba8cba4347112e4335ca02d143aec8a45f24 (patch)
tree7c625a69063fc6aecbc4eb6384d5a561ce94e3ad /zenstore/compactcas.h
parentImproved ZenCacheStore::DropBucket logic and added logging (diff)
downloadzen-9497ba8cba4347112e4335ca02d143aec8a45f24.tar.xz
zen-9497ba8cba4347112e4335ca02d143aec8a45f24.zip
Implemented more formalised CAS chunk filtering (with plenty of room for optimization)
Diffstat (limited to 'zenstore/compactcas.h')
-rw-r--r--zenstore/compactcas.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/zenstore/compactcas.h b/zenstore/compactcas.h
index c65af0435..05bbf81f6 100644
--- a/zenstore/compactcas.h
+++ b/zenstore/compactcas.h
@@ -40,12 +40,22 @@ struct CasDiskIndexEntry
static_assert(sizeof(CasDiskIndexEntry) == 32);
+/** This implements a storage strategy for small CAS values
+ *
+ * New chunks are simply appended to a small object file, and an index is
+ * maintained to allow chunks to be looked up within the active small object
+ * files
+ *
+ */
+
struct CasContainerStrategy
{
CasContainerStrategy(const CasStoreConfiguration& Config, CasStore::Stats& Stats) : m_Config(Config), m_Stats(Stats) {}
- CasStore::InsertResult InsertChunk(const void* chunkData, size_t chunkSize, const IoHash& chunkHash);
+ CasStore::InsertResult InsertChunk(const void* ChunkData, size_t ChunkSize, const IoHash& ChunkHash);
CasStore::InsertResult InsertChunk(IoBuffer Chunk, const IoHash& chunkHash);
- IoBuffer FindChunk(const IoHash& chunkHash);
+ IoBuffer FindChunk(const IoHash& ChunkHash);
+ bool HaveChunk(const IoHash& ChunkHash);
+ void FilterChunks(CasChunkSet& InOutChunks);
void Initialize(const std::string_view ContainerBaseName, uint64_t Alignment, bool IsNewStore);
void Flush();