diff options
Diffstat (limited to 'src/zenserver/hub/storageserverinstance.h')
| -rw-r--r-- | src/zenserver/hub/storageserverinstance.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/zenserver/hub/storageserverinstance.h b/src/zenserver/hub/storageserverinstance.h index 1b0078d87..21ac1ada3 100644 --- a/src/zenserver/hub/storageserverinstance.h +++ b/src/zenserver/hub/storageserverinstance.h @@ -2,6 +2,8 @@ #pragma once +#include "hydration.h" + #include <zencore/compactbinary.h> #include <zenutil/zenserverprocess.h> @@ -10,6 +12,8 @@ namespace zen { +class WorkerThreadPool; + /** * Storage Server Instance * @@ -23,15 +27,23 @@ public: struct Configuration { uint16_t BasePort; - std::filesystem::path HydrationTempPath; - std::string HydrationTargetSpecification; - CbObject HydrationOptions; + std::filesystem::path StateDir; + std::filesystem::path TempDir; uint32_t HttpThreadCount = 0; // Automatic int CoreLimit = 0; // Automatic std::filesystem::path ConfigPath; + std::string Malloc; + std::string Trace; + std::string TraceHost; + std::string TraceFile; + + WorkerThreadPool* OptionalWorkerPool = nullptr; }; - StorageServerInstance(ZenServerEnvironment& RunEnvironment, const Configuration& Config, std::string_view ModuleId); + StorageServerInstance(ZenServerEnvironment& RunEnvironment, + HydrationBase& Hydration, + const Configuration& Config, + std::string_view ModuleId); ~StorageServerInstance(); inline std::string_view GetModuleId() const { return m_ModuleId; } @@ -109,6 +121,7 @@ public: void Provision(); void Deprovision(); + void Obliterate(); void Hibernate(); void Wake(); @@ -122,27 +135,29 @@ public: private: void ProvisionLocked(); void DeprovisionLocked(); + void ObliterateLocked(); void HibernateLocked(); void WakeLocked(); mutable RwLock m_Lock; + HydrationBase& m_Hydration; const Configuration m_Config; std::string m_ModuleId; ZenServerInstance m_ServerInstance; - std::filesystem::path m_BaseDir; - - std::filesystem::path m_TempDir; + CbObject m_HydrationState; #if ZEN_PLATFORM_WINDOWS JobObject* m_JobObject = nullptr; #endif void SpawnServerProcess(); + void ShutdownServerProcess(); - void Hydrate(); - void Dehydrate(); + void Hydrate(); + void Dehydrate(); + HydrationConfig MakeHydrationConfig(std::atomic<bool>& AbortFlag, std::atomic<bool>& PauseFlag); friend class SharedLockedPtr; friend class ExclusiveLockedPtr; |