aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp35
1 files changed, 14 insertions, 21 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 801a98523..31ca8851a 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -17,8 +17,8 @@
#include <zenhttp/httpserver.h>
#include <zenhttp/websocket.h>
#include <zenstore/basicfile.h>
-#include <zenstore/cas.h>
#include <zenstore/cidstore.h>
+#include <zenstore/scrubcontext.h>
#include <zenutil/zenserverprocess.h>
#if ZEN_PLATFORM_WINDOWS
@@ -56,7 +56,6 @@ ZEN_THIRD_PARTY_INCLUDES_END
//////////////////////////////////////////////////////////////////////////
-#include "casstore.h"
#include "config.h"
#include "diag/logging.h"
@@ -103,6 +102,7 @@ ZEN_THIRD_PARTY_INCLUDES_END
#include "auth/authservice.h"
#include "cache/structuredcache.h"
#include "cache/structuredcachestore.h"
+#include "cidstore.h"
#include "compute/function.h"
#include "diag/diagsvcs.h"
#include "experimental/usnjournal.h"
@@ -253,17 +253,16 @@ public:
ZEN_INFO("initializing storage");
- zen::CasStoreConfiguration Config;
+ zen::CidStoreConfiguration Config;
Config.RootDirectory = m_DataRoot / "cas";
- m_CasStore->Initialize(Config);
-
- m_CidStore = std::make_unique<zen::CidStore>(*m_CasStore, m_DataRoot / "cid");
- m_CasGc.SetCidStore(m_CidStore.get());
+ m_CidStore = std::make_unique<zen::CidStore>(m_GcManager);
+ m_CidStore->Initialize(Config);
+ m_CidService.reset(new zen::HttpCidService{*m_CidStore});
ZEN_INFO("instantiating project service");
- m_ProjectStore = new zen::ProjectStore(*m_CidStore, m_DataRoot / "projects", m_CasGc);
+ m_ProjectStore = new zen::ProjectStore(*m_CidStore, m_DataRoot / "projects", m_GcManager);
m_HttpProjectService.reset(new zen::HttpProjectService{*m_CidStore, m_ProjectStore});
#if ZEN_WITH_EXEC_SERVICES
@@ -274,7 +273,7 @@ public:
std::filesystem::path SandboxDir = m_DataRoot / "exec" / "sandbox";
zen::CreateDirectories(SandboxDir);
- m_HttpLaunchService = std::make_unique<zen::HttpLaunchService>(*m_CasStore, SandboxDir);
+ m_HttpLaunchService = std::make_unique<zen::HttpLaunchService>(*m_CidStore, SandboxDir);
}
else
{
@@ -328,7 +327,7 @@ public:
m_Http->RegisterService(*m_HttpProjectService);
}
- m_Http->RegisterService(m_CasService);
+ m_Http->RegisterService(*m_CidService);
#if ZEN_WITH_EXEC_SERVICES
if (ServerOptions.ExecServiceEnabled)
@@ -522,7 +521,6 @@ public:
ZEN_INFO("Storage validation STARTING");
ScrubContext Ctx;
- m_CasStore->Scrub(Ctx);
m_CidStore->Scrub(Ctx);
m_ProjectStore->Scrub(Ctx);
m_StructuredCacheService->Scrub(Ctx);
@@ -538,9 +536,6 @@ public:
void Flush()
{
- if (m_CasStore)
- m_CasStore->Flush();
-
if (m_CidStore)
m_CidStore->Flush();
@@ -602,14 +597,13 @@ private:
std::unique_ptr<zen::HttpAuthService> m_AuthService;
zen::HttpStatusService m_StatusService;
zen::HttpStatsService m_StatsService;
- zen::CasGc m_CasGc;
- zen::GcScheduler m_GcScheduler{m_CasGc};
- std::unique_ptr<zen::CasStore> m_CasStore{zen::CreateCasStore(m_CasGc)};
+ zen::GcManager m_GcManager;
+ zen::GcScheduler m_GcScheduler{m_GcManager};
std::unique_ptr<zen::CidStore> m_CidStore;
std::unique_ptr<zen::ZenCacheStore> m_CacheStore;
zen::HttpTestService m_TestService;
zen::HttpTestingService m_TestingService;
- zen::HttpCasService m_CasService{*m_CasStore};
+ std::unique_ptr<zen::HttpCidService> m_CidService;
zen::RefPtr<zen::ProjectStore> m_ProjectStore;
std::unique_ptr<zen::HttpProjectService> m_HttpProjectService;
std::unique_ptr<zen::UpstreamCache> m_UpstreamCache;
@@ -745,7 +739,7 @@ ZenServer::InitializeStructuredCache(const ZenServerOptions& ServerOptions)
ZEN_INFO("instantiating structured cache service");
m_CacheStore = std::make_unique<ZenCacheStore>(
- m_CasGc,
+ m_GcManager,
ZenCacheStore::Configuration{.BasePath = m_DataRoot / "cache", .AllowAutomaticCreationOfNamespaces = true});
const ZenUpstreamCacheConfig& UpstreamConfig = ServerOptions.UpstreamCacheConfig;
@@ -873,8 +867,7 @@ ZenServer::InitializeCompute(const ZenServerOptions& ServerOptions)
.OpenIdProvider = UpstreamConfig.HordeConfig.StorageOpenIdProvider,
.AccessToken = UpstreamConfig.HordeConfig.StorageAccessToken};
- m_HttpFunctionService = std::make_unique<zen::HttpFunctionService>(*m_CasStore,
- *m_CidStore,
+ m_HttpFunctionService = std::make_unique<zen::HttpFunctionService>(*m_CidStore,
ComputeOptions,
StorageOptions,
ComputeAuthConfig,