Skip to content

Commit

Permalink
HPCC-32803 Changes following review
Browse files Browse the repository at this point in the history
Signed-off-by: Shamser Ahmed <[email protected]>
  • Loading branch information
shamser committed Nov 1, 2024
1 parent 4f6cbe7 commit 279edc1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions dali/ft/filecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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<IException> error;
cost_type totalWriteCost = 0;
if (distributedTarget)
{
cost_type totalWriteCost = 0;
StringBuffer failedParts;
CRC32Merger partCRC;
offset_t partLength = 0;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions dali/ft/filecopy.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 3694 files

0 comments on commit 279edc1

Please sign in to comment.