Skip to content

Commit 4814af3

Browse files
committed
HPCC-35694 Expose single field for physical File Size
Regardless of compression status this field has the actual physical size on disk. - Add FileSize field to DFUQuery response to hold DFUSFSize - Update ECL Watch to use FileSize when present Signed-off-by: Terrence Asselin <terrence.asselin+copilot@lexisnexisrisk.com>
1 parent 0945eea commit 4814af3

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

esp/scm/ws_dfu_common.ecm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ ESPStruct DFULogicalFile
5959
[min_ver("1.63"), nil_remove] int64 MaxSkew;
6060
[min_ver("1.63"), nil_remove] int64 MinSkewPart;
6161
[min_ver("1.63"), nil_remove] int64 MaxSkewPart;
62+
[min_ver("1.68")] int64 FileSize;
6263
};

esp/services/ws_dfu/ws_dfuHelpers.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,26 @@ bool WsDFUHelpers::addToLogicalFileList(IPropertyTree& file, const char* nodeGro
197197
lFile->setMinSkewPart(file.getPropInt64(getDFUQResultFieldName(DFUQResultField::minSkewPart)));
198198
}
199199

200+
if (version >= 1.68)
201+
{
202+
if (file.hasProp(getDFUQResultFieldName(DFUQResultField::size)))
203+
lFile->setFileSize(file.getPropInt64(getDFUQResultFieldName(DFUQResultField::size)));
204+
else
205+
{
206+
if (isFileCompressed)
207+
{
208+
if (file.hasProp(getDFUQResultFieldName(DFUQResultField::compressedsize)))
209+
lFile->setFileSize(file.getPropInt64(getDFUQResultFieldName(DFUQResultField::compressedsize)));
210+
else if (isKeyFile)
211+
lFile->setFileSize(size);
212+
}
213+
else
214+
{
215+
lFile->setFileSize(size);
216+
}
217+
}
218+
}
219+
200220
logicalFiles.append(*lFile.getClear());
201221
}
202222
catch(IException* e)

esp/src/src-react/components/Files.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,17 @@ export const Files: React.FunctionComponent<FilesProps> = ({
212212
FileSize: {
213213
label: nlsHPCC.FileSize,
214214
formatter: (value, row) => {
215+
if (row.FileSize) {
216+
return Utility.convertedSize(row.FileSize);
217+
}
215218
return Utility.convertedSize(row.IsCompressed ? row.CompressedFileSize : row.IntSize);
216219
},
217-
csvFormatter: (value, row) => row.IsCompressed ? row.CompressedFileSize : row.IntSize,
220+
csvFormatter: (value, row) => {
221+
if (row.FileSize) {
222+
return row.FileSize;
223+
}
224+
return row.IsCompressed ? row.CompressedFileSize : row.IntSize;
225+
},
218226
},
219227
Compression: {
220228
label: nlsHPCC.Compression,

0 commit comments

Comments
 (0)