DDC: Split FPayload into separate FValue and FValueId types

A payload was conceptually a value with an ID. That has been formalized by removing the ID from the payload and having separate FValue and FValueId types. This separation cleans up the API in a few areas, and provides a more natural path to providing a basic key/value API.

#rb Zousar.Shaker
#rnx
#preflight 61d704c04c252480ca284d61

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18531844 in //UE5/Release-5.0/... via CL 18531856
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18531864 by devin doucette in ue5-release-engine-test branch]
This commit is contained in:
devin doucette
2022-01-06 11:05:57 -05:00
parent bd386a95d6
commit 35393bbb2b
52 changed files with 928 additions and 889 deletions

View File

@@ -8,9 +8,9 @@
#include "DerivedDataBuildOutput.h"
#include "DerivedDataBuildTypes.h"
#include "DerivedDataBuildWorker.h"
#include "DerivedDataPayload.h"
#include "DerivedDataRequest.h"
#include "DerivedDataRequestOwner.h"
#include "DerivedDataValue.h"
#include "Features/IModularFeatures.h"
#include "HAL/Event.h"
#include "HAL/PlatformProcess.h"
@@ -238,30 +238,30 @@ public:
}
FBuildOutputBuilder OutputBuilder = BuildSystem.CreateOutput(Action.GetName(), Action.GetFunction());
for (const FPayload& Payload : RemoteBuildOutput.Get().GetPayloads())
for (const FValueWithId& Value : RemoteBuildOutput.Get().GetValues())
{
if (EnumHasAnyFlags(Policy.GetPayloadPolicy(Payload.GetId()), EBuildPolicy::SkipData))
if (EnumHasAnyFlags(Policy.GetValuePolicy(Value.GetId()), EBuildPolicy::SkipData))
{
OutputBuilder.AddPayload(Payload);
OutputBuilder.AddValue(Value.GetId(), Value);
}
else
{
FCompressedBuffer BufferForPayload;
FCompressedBuffer BufferForValue;
TStringBuilder<128> Path;
FPathViews::Append(Path, SandboxRoot, TEXT("Outputs"), FIoHash(Payload.GetRawHash()));
FPathViews::Append(Path, SandboxRoot, TEXT("Outputs"), FIoHash(Value.GetRawHash()));
if (TUniquePtr<FArchive> Ar{IFileManager::Get().CreateFileReader(*Path, FILEREAD_Silent)})
{
BufferForPayload = FCompressedBuffer::Load(*Ar);
BufferForValue = FCompressedBuffer::Load(*Ar);
}
if (BufferForPayload.IsNull())
if (BufferForValue.IsNull())
{
UE_LOG(LogDerivedDataBuildLocalExecutor, Warning, TEXT("Remote execution system error: payload blob missing!"));
return OnComplete({Action.GetKey(), {}, {}, EStatus::Error});
}
OutputBuilder.AddPayload(FPayload(Payload.GetId(), BufferForPayload));
OutputBuilder.AddValue(Value.GetId(), FValue(MoveTemp(BufferForValue)));
}
}