aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-05-01 22:34:31 +0200
committerDan Engelbrecht <[email protected]>2022-05-01 22:34:31 +0200
commitbe12749e0adde39d47875d3c4d2136dbcffbcb3d (patch)
tree9cb340f4b66ea30472f1fea4ac130bd69786ee53 /zenserver/cache/structuredcachestore.h
parentthreading issues resolved (diff)
downloadzen-be12749e0adde39d47875d3c4d2136dbcffbcb3d.tar.xz
zen-be12749e0adde39d47875d3c4d2136dbcffbcb3d.zip
collectgarbage for compactcas and structured cache uses shared implementation
Diffstat (limited to 'zenserver/cache/structuredcachestore.h')
-rw-r--r--zenserver/cache/structuredcachestore.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/zenserver/cache/structuredcachestore.h b/zenserver/cache/structuredcachestore.h
index c107983b5..0c2a7c0b2 100644
--- a/zenserver/cache/structuredcachestore.h
+++ b/zenserver/cache/structuredcachestore.h
@@ -255,6 +255,7 @@ private:
std::string m_BucketName;
std::filesystem::path m_BucketDir;
std::filesystem::path m_BlocksBasePath;
+ BlockStore m_BlockStore;
Oid m_BucketId;
bool m_IsOk = false;
uint64_t m_LargeObjectThreshold = 64 * 1024;
@@ -286,20 +287,15 @@ private:
using IndexMap = tsl::robin_map<IoHash, IndexEntry, IoHash::Hasher>;
- RwLock m_IndexLock;
- IndexMap m_Index;
- std::unordered_map<uint32_t, Ref<BlockStoreFile>> m_ChunkBlocks;
+ RwLock m_IndexLock;
+ IndexMap m_Index;
- RwLock m_InsertLock; // used to serialize inserts
- Ref<BlockStoreFile> m_WriteBlock;
- std::uint64_t m_CurrentInsertOffset = 0;
-
- std::atomic_uint32_t m_WriteBlockIndex{};
std::atomic_uint64_t m_TotalSize{};
void BuildPath(PathBuilderBase& Path, const IoHash& HashKey);
void PutStandaloneCacheValue(const IoHash& HashKey, const ZenCacheValue& Value);
bool GetStandaloneCacheValue(const DiskLocation& Loc, const IoHash& HashKey, ZenCacheValue& OutValue);
+ void PutInlineCacheValue(const IoHash& HashKey, const ZenCacheValue& Value);
bool GetInlineCacheValue(const DiskLocation& Loc, ZenCacheValue& OutValue);
void MakeIndexSnapshot();
uint64_t ReadIndexFile();