aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-06-17 07:06:21 -0700
committerGitHub <[email protected]>2022-06-17 07:06:21 -0700
commitc7e22a4ef1cce7103b9afbeec487461cb32f8dbe (patch)
tree8b99d51bf496c96f82161c18fbdcfd5c6f8f31fd /zenserver/cache/structuredcache.cpp
parentfixed merge mistake which caused a build error (diff)
downloadzen-c7e22a4ef1cce7103b9afbeec487461cb32f8dbe.tar.xz
zen-c7e22a4ef1cce7103b9afbeec487461cb32f8dbe.zip
Make cas storage an hidden implementation detail of CidStore (#130)v0.1.4-pre6v0.1.4-pre5
- Bumped ZEN_SCHEMA_VERSION - CasStore no longer a public API, it is hidden behind CidStore - Moved cas.h from public header folder - CidStore no longer maps from Cid -> Cas, we store entries in Cas under RawHash - CasStore now decompresses data to validate content (matching against RawHash) - CasChunkSet renames to HashKeySet and put in separate header/cpp file - Disabled "Chunk" command for now as it relied on CAS being exposed as a service - Changed CAS http service to Cid http server - Moved "Run" command completely inside ZEN_WITH_EXEC_SERVICES define - Removed "cas.basic" test - Uncommented ".exec.basic" test and added return-skip at start of test - Moved ScrubContext to separate header file - Renamed CasGC to GcManager - Cleaned up configuration passing in cas store classes - Removed CAS stuff from GcContext and clarified naming in class - Remove migration code
Diffstat (limited to 'zenserver/cache/structuredcache.cpp')
-rw-r--r--zenserver/cache/structuredcache.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp
index 45bbe062b..1f89e7362 100644
--- a/zenserver/cache/structuredcache.cpp
+++ b/zenserver/cache/structuredcache.cpp
@@ -16,7 +16,6 @@
#include <zencore/trace.h>
#include <zenhttp/httpserver.h>
#include <zenhttp/httpshared.h>
-#include <zenstore/cas.h>
#include <zenutil/cache/cache.h>
//#include "cachekey.h"
@@ -26,6 +25,7 @@
#include "upstream/upstreamcache.h"
#include "upstream/zen.h"
#include "zenstore/cidstore.h"
+#include "zenstore/scrubcontext.h"
#include <algorithm>
#include <atomic>
@@ -859,7 +859,7 @@ HttpStructuredCacheService::HandlePutCacheRecord(zen::HttpServerRequest& Request
CompressedBuffer Chunk = Attachment->AsCompressedBinary();
CidStore::InsertResult InsertResult = m_CidStore.AddChunk(Chunk);
- ValidAttachments.emplace_back(InsertResult.DecompressedId);
+ ValidAttachments.emplace_back(Hash);
if (InsertResult.New)
{
@@ -1205,7 +1205,7 @@ HttpStructuredCacheService::PutCacheRecord(PutRequestData& Request, const CbPack
CompressedBuffer Chunk = Attachment->AsCompressedBinary();
CidStore::InsertResult InsertResult = m_CidStore.AddChunk(Chunk);
- ValidAttachments.emplace_back(InsertResult.DecompressedId);
+ ValidAttachments.emplace_back(ValueHash);
if (InsertResult.New)
{
@@ -2382,7 +2382,7 @@ HttpStructuredCacheService::HandleStatsRequest(zen::HttpServerRequest& Request)
const uint64_t MissCount = m_CacheStats.MissCount;
const uint64_t TotalCount = HitCount + MissCount;
- const CasStoreSize CasSize = m_CidStore.CasSize();
+ const CidStoreSize CidSize = m_CidStore.TotalSize();
const GcStorageSize CacheSize = m_CacheStore.StorageSize();
Cbo.BeginObject("cache");
@@ -2400,12 +2400,12 @@ HttpStructuredCacheService::HandleStatsRequest(zen::HttpServerRequest& Request)
m_UpstreamCache.GetStatus(Cbo);
Cbo.EndObject();
- Cbo.BeginObject("cas");
+ Cbo.BeginObject("cid");
Cbo.BeginObject("size");
- Cbo << "tiny" << CasSize.TinySize;
- Cbo << "small" << CasSize.SmallSize;
- Cbo << "large" << CasSize.LargeSize;
- Cbo << "total" << CasSize.TotalSize;
+ Cbo << "tiny" << CidSize.TinySize;
+ Cbo << "small" << CidSize.SmallSize;
+ Cbo << "large" << CidSize.LargeSize;
+ Cbo << "total" << CidSize.TotalSize;
Cbo.EndObject();
Cbo.EndObject();