Files
UnrealEngineUWP/Engine/Source/Developer/Virtualization/Private/VirtualizationDDCBackend.h
paul chipchase 462290f718 Extending the VA pulling API to allow for batch pulls
#rb Per.Larsson
#jira UE-163093
#rnx
#preflight 63526abcae33b04ec1ee4a65

- The caller can now request more than one payload to be pulled froim the system at a time. In theory this will allow backends to pull data quicker.
-- The file system backend works with the new system but makes no attempt to take advantage as the backend is not intended for serious production use.
-- The DDC backend should be taking full advantage of the new batching API
-- Note that although the source control API does attempt to take advantage of batching, the internal source control API implementation is not doing so. This will be addressed in a future submit.
- This does make the pulling logic a bit more complicated in FVirtualizationManager as we need to deal with some payloads being found in the first backend, some in the second and some in the third etc.
-- To help deal with this a new class FPullRequestCollection has been added which abstracts a lot of complexity away.

[CL 22707955 by paul chipchase in ue5-main branch]
2022-10-21 22:27:40 -04:00

59 lines
1.9 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 EConnectionStatus OnConnect() override;
virtual bool PushData(TArrayView<FPushRequest> Requests) override;
virtual bool PullData(TArrayView<FPullRequest> Requests) 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