diff options
| author | Stefan Boberg <[email protected]> | 2022-02-02 11:10:35 +0100 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2022-02-02 11:10:35 +0100 |
| commit | 2d9635876d24ac40f11fd2789f82acd875481785 (patch) | |
| tree | 5f02a9e20e57c0ae018024d88e00d4ec69342345 | |
| parent | Mash -> MeshTracker (diff) | |
| download | zen-2d9635876d24ac40f11fd2789f82acd875481785.tar.xz zen-2d9635876d24ac40f11fd2789f82acd875481785.zip | |
Some minor cleanup
| -rw-r--r-- | zenserver/upstream/upstreamapply.h | 33 | ||||
| -rw-r--r-- | zenserver/upstream/upstreamcache.h | 25 |
2 files changed, 21 insertions, 37 deletions
diff --git a/zenserver/upstream/upstreamapply.h b/zenserver/upstream/upstreamapply.h index ed73ec7f8..166fc7833 100644 --- a/zenserver/upstream/upstreamapply.h +++ b/zenserver/upstream/upstreamapply.h @@ -114,26 +114,20 @@ struct UpstreamApplyEndpointStats }; /** - * The upstream apply endpont is responsible for handling remote execution. + * The upstream apply endpoint is responsible for handling remote execution. */ class UpstreamApplyEndpoint { public: virtual ~UpstreamApplyEndpoint() = default; - virtual UpstreamEndpointHealth Initialize() = 0; - - virtual bool IsHealthy() const = 0; - - virtual UpstreamEndpointHealth CheckHealth() = 0; - - virtual std::string_view DisplayName() const = 0; - - virtual PostUpstreamApplyResult PostApply(const UpstreamApplyRecord& ApplyRecord) = 0; - - virtual GetUpstreamApplyUpdatesResult GetUpdates() = 0; - - virtual UpstreamApplyEndpointStats& Stats() = 0; + virtual UpstreamEndpointHealth Initialize() = 0; + virtual bool IsHealthy() const = 0; + virtual UpstreamEndpointHealth CheckHealth() = 0; + virtual std::string_view DisplayName() const = 0; + virtual PostUpstreamApplyResult PostApply(const UpstreamApplyRecord& ApplyRecord) = 0; + virtual GetUpstreamApplyUpdatesResult GetUpdates() = 0; + virtual UpstreamApplyEndpointStats& Stats() = 0; }; /** @@ -144,8 +138,7 @@ class UpstreamApply public: virtual ~UpstreamApply() = default; - virtual bool Initialize() = 0; - + virtual bool Initialize() = 0; virtual void RegisterEndpoint(std::unique_ptr<UpstreamApplyEndpoint> Endpoint) = 0; struct EnqueueResult @@ -160,11 +153,9 @@ public: bool Success = false; }; - virtual EnqueueResult EnqueueUpstream(UpstreamApplyRecord ApplyRecord) = 0; - - virtual StatusResult GetStatus(const IoHash& WorkerId, const IoHash& ActionId) = 0; - - virtual void GetStatus(CbObjectWriter& CbO) = 0; + virtual EnqueueResult EnqueueUpstream(UpstreamApplyRecord ApplyRecord) = 0; + virtual StatusResult GetStatus(const IoHash& WorkerId, const IoHash& ActionId) = 0; + virtual void GetStatus(CbObjectWriter& CbO) = 0; }; std::unique_ptr<UpstreamApply> MakeUpstreamApply(const UpstreamApplyOptions& Options, CasStore& CasStore, CidStore& CidStore); diff --git a/zenserver/upstream/upstreamcache.h b/zenserver/upstream/upstreamcache.h index 994129fc4..b60c369dc 100644 --- a/zenserver/upstream/upstreamcache.h +++ b/zenserver/upstream/upstreamcache.h @@ -136,29 +136,26 @@ struct UpstreamEndpointInfo }; /** - * The upstream endpont is responsible for handling upload/downloading of cache records. + * The upstream endpoint is responsible for handling upload/downloading of cache records. */ class UpstreamEndpoint { public: virtual ~UpstreamEndpoint() = default; - virtual const UpstreamEndpointInfo& GetEndpointInfo() const = 0; - virtual UpstreamEndpointStatus Initialize() = 0; - virtual UpstreamEndpointState GetState() = 0; + virtual const UpstreamEndpointInfo& GetEndpointInfo() const = 0; + virtual UpstreamEndpointState GetState() = 0; virtual UpstreamEndpointStatus GetStatus() = 0; - virtual GetUpstreamCacheResult GetCacheRecord(CacheKey CacheKey, ZenContentType Type) = 0; - + virtual GetUpstreamCacheResult GetCacheRecord(CacheKey CacheKey, ZenContentType Type) = 0; virtual GetUpstreamCacheResult GetCacheRecords(std::span<CacheKeyRequest*> Requests, OnCacheRecordGetComplete&& OnComplete) = 0; virtual GetUpstreamCacheResult GetCacheValue(const CacheKey& CacheKey, const IoHash& PayloadId) = 0; - virtual GetUpstreamCacheResult GetCacheValues(std::span<CacheChunkRequest*> CacheChunkRequests, - OnCacheValueGetComplete&& OnComplete) = 0; + OnCacheValueGetComplete&& OnComplete) = 0; virtual PutUpstreamCacheResult PutCacheRecord(const UpstreamCacheRecord& CacheRecord, IoBuffer RecordValue, @@ -177,16 +174,13 @@ public: virtual void Initialize() = 0; - virtual void RegisterEndpoint(std::unique_ptr<UpstreamEndpoint> Endpoint) = 0; - + virtual void RegisterEndpoint(std::unique_ptr<UpstreamEndpoint> Endpoint) = 0; virtual void IterateEndpoints(std::function<bool(UpstreamEndpoint&)>&& Fn) = 0; - virtual GetUpstreamCacheResult GetCacheRecord(CacheKey CacheKey, ZenContentType Type) = 0; - - virtual void GetCacheRecords(std::span<CacheKeyRequest*> Requests, OnCacheRecordGetComplete&& OnComplete) = 0; - - virtual GetUpstreamCacheResult GetCacheValue(const CacheKey& CacheKey, const IoHash& ValueContentId) = 0; + virtual GetUpstreamCacheResult GetCacheRecord(CacheKey CacheKey, ZenContentType Type) = 0; + virtual void GetCacheRecords(std::span<CacheKeyRequest*> Requests, OnCacheRecordGetComplete&& OnComplete) = 0; + virtual GetUpstreamCacheResult GetCacheValue(const CacheKey& CacheKey, const IoHash& ValueContentId) = 0; virtual void GetCacheValues(std::span<CacheChunkRequest*> CacheChunkRequests, OnCacheValueGetComplete&& OnComplete) = 0; virtual void EnqueueUpstream(UpstreamCacheRecord CacheRecord) = 0; @@ -197,7 +191,6 @@ public: std::unique_ptr<UpstreamCache> MakeUpstreamCache(const UpstreamCacheOptions& Options, ZenCacheStore& CacheStore, CidStore& CidStore); std::unique_ptr<UpstreamEndpoint> MakeJupiterUpstreamEndpoint(const CloudCacheClientOptions& Options); - std::unique_ptr<UpstreamEndpoint> MakeZenUpstreamEndpoint(const ZenStructuredCacheClientOptions& Options); } // namespace zen |