diff options
| author | Dan Engelbrecht <[email protected]> | 2022-06-17 07:06:21 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-06-17 07:06:21 -0700 |
| commit | c7e22a4ef1cce7103b9afbeec487461cb32f8dbe (patch) | |
| tree | 8b99d51bf496c96f82161c18fbdcfd5c6f8f31fd /zenserver/upstream | |
| parent | fixed merge mistake which caused a build error (diff) | |
| download | zen-0.1.4-pre6.tar.xz zen-0.1.4-pre6.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/upstream')
| -rw-r--r-- | zenserver/upstream/hordecompute.cpp | 12 | ||||
| -rw-r--r-- | zenserver/upstream/upstreamapply.cpp | 9 | ||||
| -rw-r--r-- | zenserver/upstream/upstreamapply.h | 4 | ||||
| -rw-r--r-- | zenserver/upstream/upstreamcache.cpp | 1 |
4 files changed, 7 insertions, 19 deletions
diff --git a/zenserver/upstream/hordecompute.cpp b/zenserver/upstream/hordecompute.cpp index 38c798569..22b06d9c4 100644 --- a/zenserver/upstream/hordecompute.cpp +++ b/zenserver/upstream/hordecompute.cpp @@ -17,7 +17,6 @@ # include <zencore/timer.h> # include <zencore/workthreadpool.h> -# include <zenstore/cas.h> # include <zenstore/cidstore.h> # include <auth/authmgr.h> @@ -49,11 +48,9 @@ namespace detail { const UpstreamAuthConfig& ComputeAuthConfig, const CloudCacheClientOptions& StorageOptions, const UpstreamAuthConfig& StorageAuthConfig, - CasStore& CasStore, CidStore& CidStore, AuthMgr& Mgr) : m_Log(logging::Get("upstream-apply")) - , m_CasStore(CasStore) , m_CidStore(CidStore) , m_AuthMgr(Mgr) { @@ -341,7 +338,7 @@ namespace detail { } else { - DataBuffer = m_CasStore.FindChunk(Hash); + DataBuffer = m_CidStore.FindChunkByCid(Hash); if (!DataBuffer) { Log().warn("Put blob FAILED, input chunk '{}' missing", Hash); @@ -676,7 +673,6 @@ namespace detail { spdlog::logger& Log() { return m_Log; } spdlog::logger& m_Log; - CasStore& m_CasStore; CidStore& m_CidStore; AuthMgr& m_AuthMgr; std::string m_DisplayName; @@ -1218,7 +1214,7 @@ namespace detail { const IoHash ChunkId = FileEntry["hash"sv].AsHash(); const uint64_t Size = FileEntry["size"sv].AsUInt64(); - if (!m_CasStore.ContainsChunk(ChunkId)) + if (!m_CidStore.ContainsChunk(ChunkId)) { Log().warn("process apply upstream FAILED, worker CAS chunk '{}' missing", ChunkId); return false; @@ -1443,7 +1439,6 @@ UpstreamApplyEndpoint::CreateHordeEndpoint(const CloudCacheClientOptions& Comput const UpstreamAuthConfig& ComputeAuthConfig, const CloudCacheClientOptions& StorageOptions, const UpstreamAuthConfig& StorageAuthConfig, - CasStore& CasStore, CidStore& CidStore, AuthMgr& Mgr) { @@ -1451,11 +1446,10 @@ UpstreamApplyEndpoint::CreateHordeEndpoint(const CloudCacheClientOptions& Comput ComputeAuthConfig, StorageOptions, StorageAuthConfig, - CasStore, CidStore, Mgr); } } // namespace zen -#endif // ZEN_WITH_COMPUTE_SERVICES
\ No newline at end of file +#endif // ZEN_WITH_COMPUTE_SERVICES diff --git a/zenserver/upstream/upstreamapply.cpp b/zenserver/upstream/upstreamapply.cpp index c397bb141..c719b225d 100644 --- a/zenserver/upstream/upstreamapply.cpp +++ b/zenserver/upstream/upstreamapply.cpp @@ -11,7 +11,6 @@ # include <zencore/timer.h> # include <zencore/workthreadpool.h> -# include <zenstore/cas.h> # include <zenstore/cidstore.h> # include "diag/logging.h" @@ -77,10 +76,9 @@ struct UpstreamApplyStats class UpstreamApplyImpl final : public UpstreamApply { public: - UpstreamApplyImpl(const UpstreamApplyOptions& Options, CasStore& CasStore, CidStore& CidStore) + UpstreamApplyImpl(const UpstreamApplyOptions& Options, CidStore& CidStore) : m_Log(logging::Get("upstream-apply")) , m_Options(Options) - , m_CasStore(CasStore) , m_CidStore(CidStore) , m_Stats(Options.StatsEnabled) , m_UpstreamAsyncWorkPool(Options.UpstreamThreadCount) @@ -429,7 +427,6 @@ private: spdlog::logger& m_Log; UpstreamApplyOptions m_Options; - CasStore& m_CasStore; CidStore& m_CidStore; UpstreamApplyStats m_Stats; UpstreamApplyTasks m_ApplyTasks; @@ -452,9 +449,9 @@ UpstreamApply::IsHealthy() const } std::unique_ptr<UpstreamApply> -UpstreamApply::Create(const UpstreamApplyOptions& Options, CasStore& CasStore, CidStore& CidStore) +UpstreamApply::Create(const UpstreamApplyOptions& Options, CidStore& CidStore) { - return std::make_unique<UpstreamApplyImpl>(Options, CasStore, CidStore); + return std::make_unique<UpstreamApplyImpl>(Options, CidStore); } } // namespace zen diff --git a/zenserver/upstream/upstreamapply.h b/zenserver/upstream/upstreamapply.h index 1deaf00a5..4a095be6c 100644 --- a/zenserver/upstream/upstreamapply.h +++ b/zenserver/upstream/upstreamapply.h @@ -18,7 +18,6 @@ namespace zen { class AuthMgr; -class CasStore; class CbObjectWriter; class CidStore; class CloudCacheTokenProvider; @@ -153,7 +152,6 @@ public: const UpstreamAuthConfig& ComputeAuthConfig, const CloudCacheClientOptions& StorageOptions, const UpstreamAuthConfig& StorageAuthConfig, - CasStore& CasStore, CidStore& CidStore, AuthMgr& Mgr); }; @@ -186,7 +184,7 @@ public: virtual StatusResult GetStatus(const IoHash& WorkerId, const IoHash& ActionId) = 0; virtual void GetStatus(CbObjectWriter& CbO) = 0; - static std::unique_ptr<UpstreamApply> Create(const UpstreamApplyOptions& Options, CasStore& CasStore, CidStore& CidStore); + static std::unique_ptr<UpstreamApply> Create(const UpstreamApplyOptions& Options, CidStore& CidStore); }; } // namespace zen diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp index 98b4439c7..7d1f72004 100644 --- a/zenserver/upstream/upstreamcache.cpp +++ b/zenserver/upstream/upstreamcache.cpp @@ -15,7 +15,6 @@ #include <zencore/timer.h> #include <zencore/trace.h> -#include <zenstore/cas.h> #include <zenstore/cidstore.h> #include <auth/authmgr.h> |