Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataCacheMaintainer.h
devin doucette 53f316587b DDC: New filesystem cache store directory layout and file format
- Implemented only for the structured cache initially.
- Records are stored as compact binary packages with payloads stored within the record if small enough.
- Records are stored in Records/{Bucket}/{01}/{23}/{456789abcdef0123456789abcdef01234567} based on the hash in the cache key.
- Content that exceeds the size allowed for storage within the record is stored in Content/{01}/{23}/{456789abcdef0123456789abcdef01234567} based on the hash of the content.
- Both records and content are written to disk with their hash as a suffix, and are always checked on load.
- Maximum size of compressed data stored in the package can be configured by MaxRecordSizeKB and MaxValueSizeKB.
- Maintenance of the cache, to delete unused files, has been rewritten and can now scan ~175k files/second on modern hardware, though is limited to 10k files/second in the config to avoid adding too much overhead.

#rb Zousar.Shaker
#preflight 618b75c14a0c609a29204032
#preflight 618bfb5ec717ba4e929b7ac0

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18133085 in //UE5/Release-5.0/... via CL 18133356
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v889-18060218)
#ROBOMERGE[STARSHIP]: UE5-Main

[CL 18133430 by devin doucette in ue5-release-engine-test branch]
2021-11-10 13:08:00 -05:00

44 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Features/IModularFeature.h"
#include "UObject/NameTypes.h"
namespace UE::DerivedData
{
/**
* A cache store may register an instance of this interface to take part in cache maintenance.
*
* As an example, a filesystem cache might register a maintainer that scans for and deletes stale
* files within its cache directory. Boosting the priority removes any sleep between file scans.
*
* An example consumer is the DDCCleanup commandlet which uses this to boost priority and wait on
* the completion of maintenance by cache stores.
*/
class ICacheStoreMaintainer : public IModularFeature
{
public:
static inline const FLazyName FeatureName{"CacheStoreMaintainer"};
/**
* True when maintenance is not active.
*
* This must return true eventually because it is called to wait for maintenance.
*/
virtual bool IsIdle() const = 0;
/**
* Boost the priority of the active maintenance operation.
*
* This is expected to remove any delays, or otherwise allow the active maintenance operation
* to complete more quickly. This is called before waiting for maintenance to be idle.
*/
virtual void BoostPriority()
{
}
};
} // UE::DerivedData