You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb trivial #rnx #preflight 629893b95e715bebb2c2a529 - The DDC2 api is already heavily threaded so we can simply keep throwing new requests onto it and wait once all requests are made and not have to do any work ourselves. - I did ask and was told that using the batch api provided by DDC2 would not improve performance so for now I am have gone with the simple change. We may still look into changing to the batch API in the future as then we would have a reason to improve the DDC2 api. [CL 20468437 by paul chipchase in ue5-main branch]
59 lines
2.0 KiB
C++
59 lines
2.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "IVirtualizationBackend.h"
|
|
|
|
#include "DerivedDataCacheKey.h"
|
|
|
|
namespace UE::DerivedData { enum class ECachePolicy : uint32; }
|
|
|
|
namespace UE::Virtualization
|
|
{
|
|
/**
|
|
* A backend that uses the DDC2 as it's storage mechanism. It is intended to be used as a local caching
|
|
* system to speed up operations rather than for use as persistent storage.
|
|
*
|
|
* Ini file setup:
|
|
* 'Name'=(Type=DDCBackend, Bucket="XXX", LocalStorage=True/False, RemoteStorage=True/False)
|
|
*
|
|
* Required Values:
|
|
* 'Name': The backend name in the hierarchy.
|
|
*
|
|
* Optional Values:
|
|
* Bucket: An alphanumeric identifier used to group the payloads together in storage. [Default="BulkData"]
|
|
* LocalStorage: When set to true, the payloads can be stored locally. [Default=true]
|
|
* RemoteStorage: When set to true, the payloads can be stored remotely. [Default=true]
|
|
*/
|
|
class FDDCBackend final : public IVirtualizationBackend
|
|
{
|
|
public:
|
|
explicit FDDCBackend(FStringView ProjectName, FStringView ConfigName, FStringView InDebugName);
|
|
virtual ~FDDCBackend() = default;
|
|
|
|
private:
|
|
/* IVirtualizationBackend implementation */
|
|
|
|
virtual bool Initialize(const FString& ConfigEntry) override;
|
|
|
|
virtual EPushResult PushData(const FIoHash& Id, const FCompressedBuffer& Payload, const FString& PackageContext) override;
|
|
virtual bool PushData(TArrayView<FPushRequest> Requests) override;
|
|
|
|
virtual FCompressedBuffer PullData(const FIoHash& Id) override;
|
|
|
|
virtual bool DoesPayloadExist(const FIoHash& Id) override;
|
|
|
|
private:
|
|
/** The bucket being used to group together the virtualized payloads in storage */
|
|
FString BucketName;
|
|
|
|
/** The FCacheBucket used with the DDC, cached to avoid recreating it for each request */
|
|
UE::DerivedData::FCacheBucket Bucket;
|
|
|
|
/** The policy to use when uploading or downloading data from the cache */
|
|
UE::DerivedData::ECachePolicy TransferPolicy;
|
|
/** The policy to use when querying the cache for information */
|
|
UE::DerivedData::ECachePolicy QueryPolicy;
|
|
};
|
|
|
|
} // namespace UE::Virtualization
|