From c7e22a4ef1cce7103b9afbeec487461cb32f8dbe Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 17 Jun 2022 07:06:21 -0700 Subject: Make cas storage an hidden implementation detail of CidStore (#130) - 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 --- zenserver/cache/structuredcache.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'zenserver/cache/structuredcache.cpp') 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 #include #include -#include #include //#include "cachekey.h" @@ -26,6 +25,7 @@ #include "upstream/upstreamcache.h" #include "upstream/zen.h" #include "zenstore/cidstore.h" +#include "zenstore/scrubcontext.h" #include #include @@ -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(); -- cgit v1.2.3