From 279edc1ae0df55bef98960a0f610d771cafd9643 Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Wed, 30 Oct 2024 10:55:45 +0000 Subject: [PATCH] HPCC-32803 Changes following review Signed-off-by: Shamser Ahmed --- dali/ft/filecopy.cpp | 16 ++++++++++------ dali/ft/filecopy.ipp | 4 ++-- vcpkg | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dali/ft/filecopy.cpp b/dali/ft/filecopy.cpp index 368cb9cabcb..7f11032418e 100644 --- a/dali/ft/filecopy.cpp +++ b/dali/ft/filecopy.cpp @@ -3396,9 +3396,8 @@ void FileSprayer::spray() //If got here then we have succeeded //Note: On failure, costs will not be updated. Future: would be useful to have a way to update costs on failure. - cost_type totalWriteCost = 0, totalReadCost = 0; - updateTargetProperties(totalWriteCost); - updateSourceProperties(totalReadCost); + cost_type totalWriteCost = updateTargetProperties(); + cost_type totalReadCost = updateSourceProperties(); progressReport->setFileAccessCost(totalReadCost+totalWriteCost); StringBuffer copyEventText; // [logical-source] > [logical-target] @@ -3449,13 +3448,13 @@ bool FileSprayer::isSameSizeHeaderFooter() return retVal; } -void FileSprayer::updateTargetProperties(cost_type & totalReadCost) +cost_type FileSprayer::updateTargetProperties() { TimeSection timer("FileSprayer::updateTargetProperties() time"); Owned error; - cost_type totalWriteCost = 0; if (distributedTarget) { + cost_type totalWriteCost = 0; StringBuffer failedParts; CRC32Merger partCRC; offset_t partLength = 0; @@ -3806,17 +3805,20 @@ void FileSprayer::updateTargetProperties(cost_type & totalReadCost) int expireDays = options->getPropInt("@expireDays", -1); if (expireDays != -1) curProps.setPropInt("@expireDays", expireDays); + return totalWriteCost; } if (error) throw error.getClear(); + return 0; } -void FileSprayer::updateSourceProperties(cost_type & totalReadCost) +cost_type FileSprayer::updateSourceProperties() { TimeSection timer("FileSprayer::updateSourceProperties() time"); // Update file readCost and numReads in file properties and do the same for subfiles if (distributedSource) { + cost_type totalReadCost = 0; IDistributedSuperFile * superSrc = distributedSource->querySuperFile(); if (superSrc && superSrc->numSubFiles() > 0) { @@ -3861,7 +3863,9 @@ void FileSprayer::updateSourceProperties(cost_type & totalReadCost) distributedSource->addAttrValue(getDFUQResultFieldName(DFUQRFnumDiskReads), totalNumReads); cost_type legacyReadCost = getLegacyReadCost(distributedSource->queryAttributes(), distributedSource); distributedSource->addAttrValue(getDFUQResultFieldName(DFUQRFreadCost), legacyReadCost + totalReadCost); + return totalReadCost; } + return 0; } void FileSprayer::splitAndCollectFileInfo(IPropertyTree * newRecord, RemoteFilename &remoteFileName, diff --git a/dali/ft/filecopy.ipp b/dali/ft/filecopy.ipp index ce1b1da7c48..b166469e7c1 100644 --- a/dali/ft/filecopy.ipp +++ b/dali/ft/filecopy.ipp @@ -271,8 +271,8 @@ protected: void savePartition(); void setCopyCompressedRaw(); void setSource(IFileDescriptor * source, unsigned copy, unsigned mirrorCopy = (unsigned)-1); - void updateTargetProperties(cost_type & readCost); - void updateSourceProperties(cost_type & WriteCost); + cost_type updateTargetProperties(); + cost_type updateSourceProperties(); bool usePullOperation() const; bool usePushOperation() const; bool usePushWholeOperation() const; diff --git a/vcpkg b/vcpkg index ddf0c6df807..70ea56ab7b2 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit ddf0c6df807a454c74f33d7ba75037314bf9a79c +Subproject commit 70ea56ab7b2ec07bfed8b6170cecdd85b2e36fe0