UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CloudChunkSource.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
9
12
13namespace BuildPatchServices
14{
15 class IPlatform;
16 class IChunkStore;
17 class IDownloadService;
18 class IChunkReferenceTracker;
19 class IChunkDataSerialization;
20 class IMessagePump;
21 class IInstallerError;
22 class ICloudChunkSourceStat;
23 class IDownloadServiceStatistics;
24 class IBuildManifestSet;
25
27 {
28 // An array of cloud root paths, supporting HTTP(s) and file access. HTTP(s) roots must begin with the protocol.
30 // The maximum number of times that a single chunk should retry, before registering a fatal error.
31 // Infinite can be specified as < 0.
33 // Array of times in seconds, representing the time between each retry upon failure. The last entry will be used
34 // indefinitely once it is reached.
36 // Configures what success rate values apply to which EBuildPatchDownloadHealth value, there should be
37 // EBuildPatchDownloadHealth::NUM_Values entries in this array.
39 // When all requests are failing, how many seconds before a success until we determine the state as disconnected.
40 float DisconnectedDelay = 5.0f;
41
53 };
54
56 {
57 public:
59
60
61 virtual void Abort() = 0;
62
64
65 // When downloads are complete we need a way to alert the main thread.
66 virtual void SetWakeupFunction(TUniqueFunction<void()>&& WakeupMainThreadFn) = 0;
67
68 // Pass in total download requirements for the install (including already completed downloads)
70
74 };
75
80 : public IChunkSource
81 , public IControllable
82 {
83 public:
84 virtual ~ICloudChunkSource() {}
85
90 virtual void ThreadRun() = 0;
91 };
92
97 {
98 // An array of cloud root paths, supporting HTTP(s) and file access. HTTP(s) roots must begin with the protocol.
100 // The maximum number of times that a single chunk should retry, before registering a fatal error.
101 // Infinite can be specified as < 0.
103 // The minimum number of chunks to request ahead of what is required, depending on store slack.
105 // The maximum number of chunks to request ahead of what is required, depending on store slack.
106 // This shouldn't be too much because we'll queue too many on the same CDN which might not be good and we have to chew
107 // though a ton of requests before we swap over, and we only really want there to be one queued + one ready to go per connection anyway.
109 // Array of times in seconds, representing the time between each retry upon failure. The last entry will be used
110 // indefinitely once it is reached.
112 // Configures what success rate values apply to which EBuildPatchDownloadHealth value, there should be
113 // EBuildPatchDownloadHealth::NUM_Values entries in this array.
115 // When all requests are failing, how many seconds before a success until we determine the state as disconnected.
116 float DisconnectedDelay = 5.0f;
117 // If true, the downloads will not begin until the first Get request is made. It is fairly fundamental to stop downloads of chunks until resume
118 // data is processed, but can be special case disabled.
120 // The minimum time to allow a http download before assessing it as affected by TCP zero window issue.
122 // The context for allocating shared resources.
124 // Whether cloud source should run its own thread. If true, SharedContext is required.
125 bool bRunOwnThread = true;
126
142 };
143
148 {
149 public:
150
169 static ICloudChunkSource* Create(FCloudSourceConfig Configuration,
171 IChunkStore* ChunkStore,
172 IDownloadService* DownloadService,
173 IChunkReferenceTracker* ChunkReferenceTracker,
174 IChunkDataSerialization* ChunkDataSerialization,
175 IMessagePump* MessagePump,
176 IInstallerError* InstallerError,
178 ICloudChunkSourceStat* CloudChunkSourceStat,
179 IBuildManifestSet* ManifestSet,
180 TSet<FGuid> InitialDownloadSet);
181 };
182
188 {
189 public:
191
196 virtual void OnDownloadRequested(const FGuid& ChunkId) = 0;
197
202 virtual void OnDownloadSuccess(const FGuid& ChunkId) = 0;
203
209 virtual void OnDownloadFailed(const FGuid& ChunkId, const FString& Url) = 0;
210
217 virtual void OnDownloadCorrupt(const FGuid& ChunkId, const FString& Url, EChunkLoadResult LoadResult) = 0;
218
228 virtual void OnDownloadAborted(const FGuid& ChunkId, const FString& Url, double DownloadTimeMean, double DownloadTimeStd, double DownloadTime, double BreakingPoint) = 0;
229
234 virtual void OnReceivedDataUpdated(int64 TotalBytes) = 0;
235
241 virtual void OnRequiredDataUpdated(int64 TotalBytes) = 0;
242
248
254 virtual void OnSuccessRateUpdated(float SuccessRate) = 0;
255
260 virtual void OnActiveRequestCountUpdated(uint32 RequestCount) = 0;
261
266 virtual void OnAcceptedNewRequirements(const TSet<FGuid>& ChunkIds) = 0;
267 };
268}
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EBuildPatchDownloadHealth
Definition IBuildInstaller.h:88
#define UE_ARRAY_COUNT(array)
Definition UnrealTemplate.h:212
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition CloudChunkSource.h:148
Definition IBuildManifestSet.h:85
Definition ChunkReferenceTracker.h:15
Definition ChunkSource.h:34
Definition ChunkStore.h:15
Definition CloudChunkSource.h:188
virtual void OnDownloadHealthUpdated(EBuildPatchDownloadHealth DownloadHealth)=0
virtual void OnRequiredDataUpdated(int64 TotalBytes)=0
virtual void OnReceivedDataUpdated(int64 TotalBytes)=0
virtual void OnDownloadCorrupt(const FGuid &ChunkId, const FString &Url, EChunkLoadResult LoadResult)=0
virtual void OnDownloadRequested(const FGuid &ChunkId)=0
virtual ~ICloudChunkSourceStat()
Definition CloudChunkSource.h:190
virtual void OnDownloadSuccess(const FGuid &ChunkId)=0
virtual void OnDownloadAborted(const FGuid &ChunkId, const FString &Url, double DownloadTimeMean, double DownloadTimeStd, double DownloadTime, double BreakingPoint)=0
virtual void OnDownloadFailed(const FGuid &ChunkId, const FString &Url)=0
virtual void OnSuccessRateUpdated(float SuccessRate)=0
virtual void OnAcceptedNewRequirements(const TSet< FGuid > &ChunkIds)=0
virtual void OnActiveRequestCountUpdated(uint32 RequestCount)=0
Definition CloudChunkSource.h:82
virtual ~ICloudChunkSource()
Definition CloudChunkSource.h:84
Definition CloudChunkSource.h:56
virtual void SetWakeupFunction(TUniqueFunction< void()> &&WakeupMainThreadFn)=0
virtual void Tick(bool bStartNewDownloads, uint32 &OutTimeToNextTickMs, uint32 InMaxDownloads)=0
virtual ~IConstructorCloudChunkSource()
Definition CloudChunkSource.h:58
static IConstructorCloudChunkSource * CreateCloudSource(FConstructorCloudChunkSourceConfig &&Configuration, IDownloadService *InDownloadService, IChunkDataSerialization *InChunkDataSerialization, IDownloadConnectionCount *InDownloadCount, IMessagePump *InMessagePump, ICloudChunkSourceStat *InCloudChunkSourceStat, IBuildManifestSet *InManifestSet)
Definition CloudChunkSource.cpp:1484
virtual void PostRequiredByteCount(uint64 InDownloadExpected)=0
Definition Controllable.h:10
Definition DownloadConnectionCount.h:17
Definition DownloadService.h:67
Definition InstallerError.h:142
Definition MessagePump.h:13
Definition Platform.h:16
Definition IBuildInstallerSharedContext.h:33
Definition Array.h:670
void Append(const TArray< OtherElementType, OtherAllocatorType > &Source)
Definition Array.h:2412
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition FunctionFwd.h:19
Definition BuildPatchFileConstructor.h:28
Definition CloudChunkSource.h:97
int32 PreFetchMaximum
Definition CloudChunkSource.h:108
IBuildInstallerSharedContext * SharedContext
Definition CloudChunkSource.h:123
int32 PreFetchMinimum
Definition CloudChunkSource.h:104
bool bRunOwnThread
Definition CloudChunkSource.h:125
float TcpZeroWindowMinimumSeconds
Definition CloudChunkSource.h:121
int32 MaxRetryCount
Definition CloudChunkSource.h:102
bool bBeginDownloadsOnFirstGet
Definition CloudChunkSource.h:119
TArray< float > RetryDelayTimes
Definition CloudChunkSource.h:111
TArray< FString > CloudRoots
Definition CloudChunkSource.h:99
TArray< float > HealthPercentages
Definition CloudChunkSource.h:114
float DisconnectedDelay
Definition CloudChunkSource.h:116
FCloudSourceConfig(const TArray< FString > &InCloudRoots)
Definition CloudChunkSource.h:131
TArray< FString > CloudRoots
Definition CloudChunkSource.h:29
TArray< float > HealthPercentages
Definition CloudChunkSource.h:38
TArray< float > RetryDelayTimes
Definition CloudChunkSource.h:35
FConstructorCloudChunkSourceConfig(const TArray< FString > &InCloudRoots)
Definition CloudChunkSource.h:42
int32 MaxRetryCount
Definition CloudChunkSource.h:32
float DisconnectedDelay
Definition CloudChunkSource.h:40
Definition Guid.h:109