aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index 3fd9f5ec4..59588af48 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -59,23 +59,14 @@ ZenCacheStore::Get(std::string_view InBucket, const zen::IoHash& HashKey, ZenCac
void
ZenCacheStore::Put(std::string_view InBucket, const zen::IoHash& HashKey, const ZenCacheValue& Value)
{
+ // Store value and index
+
if (Value.Value.Size() <= m_DiskLayerSizeThreshold)
{
m_MemLayer.Put(InBucket, HashKey, Value);
}
m_DiskLayer.Put(InBucket, HashKey, Value);
-
- if (Value.IsCompactBinary)
- {
- zen::CbObject Cbo(SharedBuffer(Value.Value));
-
- std::vector<IoHash> ReferencedChunks;
-
- Cbo.IterateAttachments([&](CbFieldView AttachmentView) { ReferencedChunks.push_back(AttachmentView.AsHash()); });
-
- // TODO: store references in index
- }
}
//////////////////////////////////////////////////////////////////////////
@@ -176,6 +167,7 @@ struct DiskLocation
{
uint64_t Offset;
uint32_t Size;
+ uint32_t IndexDataSize;
};
struct DiskIndexEntry
@@ -186,7 +178,7 @@ struct DiskIndexEntry
#pragma pack(pop)
-static_assert(sizeof(DiskIndexEntry) == 32);
+static_assert(sizeof(DiskIndexEntry) == 36);
struct ZenCacheDiskLayer::CacheBucket
{