UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Virtualization::IVirtualizationSystem Class Referenceabstract

#include <VirtualizationSystem.h>

+ Inheritance diagram for UE::Virtualization::IVirtualizationSystem:

Public Types

enum  ENotification {
  PushBegunNotification , PushEndedNotification , PushFailedNotification , PullBegunNotification ,
  PullEndedNotification , PullFailedNotification
}
 
using GetPayloadActivityInfoFuncRef = TFunctionRef< void(const FString &DebugName, const FString &ConfigName, const FPayloadActivityInfo &PayloadInfo)>
 
using FOnNotification = TTSMulticastDelegate< void(ENotification, const FIoHash &)>
 

Public Member Functions

 IVirtualizationSystem ()=default
 
virtual ~IVirtualizationSystem ()=default
 
virtual bool Initialize (const FInitParams &InitParams)=0
 
virtual bool IsEnabled () const =0
 
virtual bool IsPushingEnabled (EStorageType StorageType) const =0
 
virtual EPayloadFilterReason FilterPayload (const UObject *Owner) const =0
 
virtual bool AllowSubmitIfVirtualizationFailed () const =0
 
virtual bool PushData (TArrayView< FPushRequest > Requests, EStorageType StorageType)=0
 
bool PushData (FPushRequest Request, EStorageType StorageType)
 
bool PushData (const FIoHash &Id, const FCompressedBuffer &Payload, const FString &Context, EStorageType StorageType)
 
virtual bool PullData (TArrayView< FPullRequest > Requests)=0
 
FCompressedBuffer PullData (const FIoHash &Id)
 
bool PullData (FPullRequest Request)
 
virtual EQueryResult QueryPayloadStatuses (TArrayView< const FIoHash > Ids, EStorageType StorageType, TArray< EPayloadStatus > &OutStatuses)=0
 
virtual FVirtualizationResult TryVirtualizePackages (TConstArrayView< FString > PackagePaths, EVirtualizationOptions Options)=0
 
virtual FRehydrationResult TryRehydratePackages (TConstArrayView< FString > PackagePaths, ERehydrationOptions Options)=0
 
virtual ERehydrationResult TryRehydratePackages (TConstArrayView< FString > PackagePaths, uint64 PaddingAlignment, TArray< FText > &OutErrors, TArray< FSharedBuffer > &OutPackages, TArray< FRehydrationInfo > *OutInfo)=0
 
virtual void DumpStats () const =0
 
virtual TArray< FBackendStatsGetBackendStatistics () const =0
 
virtual FPayloadActivityInfo GetSystemStatistics () const =0
 
virtual void GatherAnalytics (TArray< FAnalyticsEventAttribute > &Attributes) const =0
 
virtual FOnNotificationGetNotificationEvent ()=0
 

Static Public Member Functions

static CORE_API bool IsInitialized ()
 
static CORE_API FName GetSystemName ()
 
static CORE_API IVirtualizationSystemGet ()
 

Detailed Description

The base interface for the virtualization system. An Epic maintained version can be found in the Virtualization module. To implement your own, simply derived from this interface and then use the UE_REGISTER_VIRTUALIZATION_SYSTEM macro in the cpp to register it as an option. You can then set the config file option [Core.ContentVirtualization]SystemName=FooBar, where FooBar should be the SystemName parameter you used when registering with the macro.

Special Cases: SystemName=Off - This is the default set up and means a project will not use content virtualization Note that calling IVirtualizationSystem::Get() will still return a valid IVirtualizationSystem implementation, but all push and pull operations will result in failure and IsEnabled will always return false. SystemName=Default - This will cause the default Epic implementation to be used

See also
VirtualizationManager

Member Typedef Documentation

◆ FOnNotification

◆ GetPayloadActivityInfoFuncRef

Member Enumeration Documentation

◆ ENotification

Enumerator
PushBegunNotification 
PushEndedNotification 
PushFailedNotification 
PullBegunNotification 
PullEndedNotification 
PullFailedNotification 

Constructor & Destructor Documentation

◆ IVirtualizationSystem()

UE::Virtualization::IVirtualizationSystem::IVirtualizationSystem ( )
default

◆ ~IVirtualizationSystem()

virtual UE::Virtualization::IVirtualizationSystem::~IVirtualizationSystem ( )
virtualdefault

Member Function Documentation

◆ AllowSubmitIfVirtualizationFailed()

virtual bool UE::Virtualization::IVirtualizationSystem::AllowSubmitIfVirtualizationFailed ( ) const
pure virtual

Poll to see if the virtualization process failing when submitting a collection of files to source control should block that submit or allow it to continue.

NOTE: This is a bit of an odd ball option to be included in the VirtualizationSystem API but at the moment we don't really have a better place for it. This might be removed or replaced in future releases.

Returns
True if the calling code should continue with submitting files if the virtualization process failed. If it returns false then the calling code should prevent the submit.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ DumpStats()

virtual void UE::Virtualization::IVirtualizationSystem::DumpStats ( ) const
pure virtual

When called the system should write any performance stats that it has been gathering to the log file

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ FilterPayload()

virtual EPayloadFilterReason UE::Virtualization::IVirtualizationSystem::FilterPayload ( const UObject Owner) const
pure virtual

Run checks to see if the payload can be virtualized or not.

Parameters
OwnerThe UObject that contains the payload, this can be nullptr if the payload is not owned by one
Returns
The reasons why the payload can not be virtualized, encoded as a bitfield of EPayloadFilterReason. This bitfield will be EPayloadFilterReason::None (0) if no reason was found.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ GatherAnalytics()

virtual void UE::Virtualization::IVirtualizationSystem::GatherAnalytics ( TArray< FAnalyticsEventAttribute > &  Attributes) const
pure virtual

Gather analytics data. Stats will only be collected if ENABLE_COOK_STATS is enabled.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ Get()

IVirtualizationSystem & UE::Virtualization::IVirtualizationSystem::Get ( )
static

Gain access to the current virtualization system active for the project. If the system has not yet been initialized then calling this method will initialize it.

◆ GetBackendStatistics()

virtual TArray< FBackendStats > UE::Virtualization::IVirtualizationSystem::GetBackendStatistics ( ) const
pure virtual

Access profiling info relating to payload activity per backend. Stats will only be collected if ENABLE_COOK_STATS is enabled.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ GetNotificationEvent()

virtual FOnNotification & UE::Virtualization::IVirtualizationSystem::GetNotificationEvent ( )
pure virtual

◆ GetSystemName()

FName UE::Virtualization::IVirtualizationSystem::GetSystemName ( )
static

Returns the name of the currently initialized system, will be NAME_None if initialization failed or the system is not enabled

◆ GetSystemStatistics()

virtual FPayloadActivityInfo UE::Virtualization::IVirtualizationSystem::GetSystemStatistics ( ) const
pure virtual

Access profiling info for all backends combined. Stats will only be collected if ENABLE_COOK_STATS is enabled.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ Initialize()

virtual bool UE::Virtualization::IVirtualizationSystem::Initialize ( const FInitParams InitParams)
pure virtual

Initialize the system from the parameters given in the FInitParams structure. The system can only rely on the members of FInitParams to be valid for the duration of the method call, so if a system needs to retain information longer term then it should make it's own copy of the required data.

NOTE: Although it is relatively easy to access cached FConfigFiles, systems should use the one provided by InitParams to ensure that the correct settings are parsed.

Parameters
InitParamThe parameters used to initialize the system
Returns
True if the system was initialized correctly, otherwise false. Note that if the method returns false then the system will be deleted and the default FNullVirtualizationSystem will be used instead.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ IsEnabled()

virtual bool UE::Virtualization::IVirtualizationSystem::IsEnabled ( ) const
pure virtual

Poll to see if content virtualization is enabled or not.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ IsInitialized()

bool UE::Virtualization::IVirtualizationSystem::IsInitialized ( )
static

Returns true if a virtualization system has been initialized and false if not

◆ IsPushingEnabled()

virtual bool UE::Virtualization::IVirtualizationSystem::IsPushingEnabled ( EStorageType  StorageType) const
pure virtual

Poll to see if pushing virtualized content to the given backend storage type is enabled or not.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ PullData() [1/3]

FCompressedBuffer UE::Virtualization::IVirtualizationSystem::PullData ( const FIoHash Id)
inline

Pull a single payload from the virtualization backends.

Parameters
IdThe hash of the payload to pull
Returns
A valid buffer representing the payload if the pull was successful. An invalid buffer if the pull failed.

◆ PullData() [2/3]

bool UE::Virtualization::IVirtualizationSystem::PullData ( FPullRequest  Request)
inline

Pull a single payload from the virtualization backends.

Parameters
RequestA payload pull request.
See also
FPullRequest
Returns
True if the pull failed and the request will return a valid payload. False if the pull failed and the request will return an invalid payload

◆ PullData() [3/3]

virtual bool UE::Virtualization::IVirtualizationSystem::PullData ( TArrayView< FPullRequest Requests)
pure virtual

Pull a number of payloads from the virtualization backends.

Parameters
RequestsAn array of payload pull requests.
See also
FPullRequest
Returns
True if the requests succeeded, false if one or more requests failed

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ PushData() [1/3]

bool UE::Virtualization::IVirtualizationSystem::PushData ( const FIoHash Id,
const FCompressedBuffer Payload,
const FString &  Context,
EStorageType  StorageType 
)
inline

Push a payload to the virtualization backends.

Parameters
IdThe identifier of the payload being pushed.
PayloadThe payload itself in FCompressedBuffer form, it is assumed that if the buffer is to be compressed that it will have been done by the caller.
ContextContext for the payload being submitted, typically the name from the UPackage that owns it.
StorageTypeThe type of storage to push the payload to, @See EStorageType for details.
Returns
When StorageType is EStorageType::Cache this will return true as long each payload ends up being stored in at least one of the cache backends. When StorageType is EStorageType::Persistent this will only return true if each payload endd up being stored in all of the backends. This is because the cache backends are not considered essential and it is not the end of the world if a payload is missing but the persistent backends must be reliable.

◆ PushData() [2/3]

bool UE::Virtualization::IVirtualizationSystem::PushData ( FPushRequest  Request,
EStorageType  StorageType 
)
inline

Push a payload to the virtualization backends.

Parameters
RequestA single push request
PackageContextContext for the payload being submitted, typically the name from the UPackage that owns it.
Returns
When StorageType is EStorageType::Cache this will return true as long each payload ends up being stored in at least one of the cache backends. When StorageType is EStorageType::Persistent this will only return true if each payload endd up being stored in all of the backends. This is because the cache backends are not considered essential and it is not the end of the world if a payload is missing but the persistent backends must be reliable.

◆ PushData() [3/3]

virtual bool UE::Virtualization::IVirtualizationSystem::PushData ( TArrayView< FPushRequest Requests,
EStorageType  StorageType 
)
pure virtual

Push one or more payloads to a backend storage system. @See FPushRequest.

Parameters
RequestsA collection of one or more payload push requests
StorageTypeThe type of storage to push the payload to, @See EStorageType for details.
Returns
When StorageType is EStorageType::Cache this will return true as long each payload ends up being stored in at least one of the cache backends. When StorageType is EStorageType::Persistent this will only return true if each payload endd up being stored in all of the backends. This is because the cache backends are not considered essential and it is not the end of the world if a payload is missing but the persistent backends must be reliable.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ QueryPayloadStatuses()

virtual EQueryResult UE::Virtualization::IVirtualizationSystem::QueryPayloadStatuses ( TArrayView< const FIoHash Ids,
EStorageType  StorageType,
TArray< EPayloadStatus > &  OutStatuses 
)
pure virtual

Query if a number of payloads exist or not in the given storage type.

Parameters
IdsOne or more payload identifiers to test
StorageTypeThe type of storage to push the payload to, @See EStorageType for details.
OutStatuses[out] An array containing the results for each payload. @See FPayloadStatus If the operation succeeds the array will be resized to match the size of Ids.
Returns
True if the operation succeeded and the contents of OutStatuses is valid. False if errors were encountered in which case the contents of OutStatuses should be ignored.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ TryRehydratePackages() [1/2]

virtual FRehydrationResult UE::Virtualization::IVirtualizationSystem::TryRehydratePackages ( TConstArrayView< FString >  PackagePaths,
ERehydrationOptions  Options 
)
pure virtual

Runs the rehydration process on a set of packages. This involves downloading virtualized payloads and placing them back in the trailer of the given packages.

Parameters
PackagePathsAn array containing the absolute file paths of packages
OptionsAn enum bitfield containing various options for the process.
See also
EVirtualizationOptions
Parameters
OutResultInfoA struct that will contain info about the process.
See also
FVirtualizationResult
Returns
A ERehydrationResult enum with the status of the process. If the status indicates any sort of failure then OutResultInfo.Errors should contain at least one entry.

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ TryRehydratePackages() [2/2]

virtual ERehydrationResult UE::Virtualization::IVirtualizationSystem::TryRehydratePackages ( TConstArrayView< FString >  PackagePaths,
uint64  PaddingAlignment,
TArray< FText > &  OutErrors,
TArray< FSharedBuffer > &  OutPackages,
TArray< FRehydrationInfo > *  OutInfo 
)
pure virtual

Rehydrates a number of packages into memory buffers. Note that if a package does not require rehydration we will still return the package in a memory buffer but it will be the same as the package on disk.

Parameters
PackagePathsAn array containing the absolute file paths of packages.
PaddingAlignmentByte alignment to pad each package buffer too, a value of 0 will result in the buffers being the same size as the packages
OutErrorsAny errors encountered while rehydration will be added here
OutPackagesThe rehydrated packages as memory buffers. Each entry should match the corresponding entry in PackagePaths. This array is only guaranteed to be correct if the method returns ERehydrationResult::Success.
OutInfoInformation about the rehydration process, each entry should match the corresponding entry in PackagePaths assuming that the method returns ERehydrationResult::Success. This parameter is optional, if the information is not required then pass in nullptr to skip.
Returns
ERehydrationResult::Success if the rehydration suceeeds and OutPackages/OutInfocan be trued, otherwise it will return an error value.
See also
ERehydrationResult

Implemented in UE::Virtualization::FNullVirtualizationSystem.

◆ TryVirtualizePackages()

virtual FVirtualizationResult UE::Virtualization::IVirtualizationSystem::TryVirtualizePackages ( TConstArrayView< FString >  PackagePaths,
EVirtualizationOptions  Options 
)
pure virtual

Runs the virtualization process on a set of packages. All of the packages will be parsed and any found to be containing locally stored payloads will have them removed but before they are removed they will be pushed to persistent storage.

Note that if errors occur some or all of the payloads could still get pushed to persistent storage, usually if the errors occur when trying to remove the now virtualized payload from the packages on disk. In addition, if errors do occur when removing the virtualized payloads, some packages may be virtualized successfully. In any case the packages should still be usable and safe to checkin after the process has run, even with failure cases.

Parameters
PackagePathsAn array of file paths to packages that should be virtualized. If a path resolves to a file that is not a valid package then it will be silently skipped and will not be considered an error.
OptionsAn enum bitfield containing various options for the process.
See also
EVirtualizationOptions
Parameters
OutResultInfoA struct that will contain info about the process.
See also
FVirtualizationResult
Returns
A EVirtualizationResult enum with the status of the process. If the status is not EVirtualizationResult::Success then the parameter OutErrors should contain at least one entry.

Implemented in UE::Virtualization::FNullVirtualizationSystem.


The documentation for this class was generated from the following files: