Skip to content

Commit 61d38d2

Browse files
authored
Merge pull request #21018 from jeclrsg/hpcc-33975-FileSpray-Copy-destNumParts
HPCC-33975 ws_fsService onCopy expose DestNumParts Reviewed-By: Terrence Asselin <terrence.asselin@lexisnexisrisk.com> Merged-by: Gavin Halliday <gavin.halliday@lexisnexisrisk.com>
2 parents 7f5829a + 02bde60 commit 61d38d2

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

esp/scm/ws_fs.ecm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ ESPrequest [nil_remove] Copy
509509
[min_ver("1.14")] string DFUServerQueue;
510510
[min_ver("1.17")] int ExpireDays;
511511
[min_ver("1.27")] string KeyCompression;
512+
513+
// Overrides destination part count; 0 = use system/default destination part count
514+
[min_ver("1.28")] int DestNumParts(0);
512515
};
513516

514517
ESPresponse [exceptions_inline]
@@ -728,7 +731,7 @@ ESPresponse [exceptions_inline, nil_remove] GetRemoteTargetsResponse
728731

729732
ESPservice [
730733
auth_feature("DEFERRED"),
731-
version("1.27"),
734+
version("1.28"),
732735
exceptions_inline("./smc_xslt/exceptions.xslt")] FileSpray
733736
{
734737
ESPmethod EchoDateTime(EchoDateTime, EchoDateTimeResponse);

esp/services/ws_fs/ws_fsService.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ void CFileSprayEx::readAndCheckSpraySourceReq(IEspContext& context, MemoryBuffer
20232023
{
20242024
//The sourceIPReq should must have been supplied here. This has been verified if
20252025
//the sourcePlaneReq is empty. When the sourcePlaneReq is not empty, the dropZone
2026-
//should not be null. Otherwise, an exception should already be thrown.
2026+
//should not be null. Otherwise, an exception should already be thrown.
20272027
dropZone.setown(getAndValidateDropZone(nullptr, sourceIPReq));
20282028
if (dropZone)
20292029
sourcePlaneReq.append(dropZone->queryProp("@name"));
@@ -2876,6 +2876,8 @@ bool CFileSprayEx::onCopy(IEspContext &context, IEspCopy &req, IEspCopyResponse
28762876
mspec.setDefaultBaseDir(defaultFolder.str());
28772877
mspec.setDefaultReplicateDir(defaultReplicateFolder.str());
28782878
wuFSpecDest->setClusterPartDiskMapSpec(destNodeGroup.str(), mspec);
2879+
if (!req.getDestNumParts_isNull() && req.getDestNumParts() > 0)
2880+
wuFSpecDest->setNumPartsOverride(req.getDestNumParts());
28792881
}
28802882

28812883
resp.setResult(wu->queryId());
@@ -3561,7 +3563,7 @@ bool CFileSprayEx::onDeleteDropZoneFiles(IEspContext &context, IEspDeleteDropZon
35613563
{
35623564
const char* file = files.item(idx);
35633565
if (containsRelPaths(file))
3564-
throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "Invalid file %s", file);
3566+
throw makeStringExceptionV(ECLWATCH_INVALID_INPUT, "Invalid file %s", file);
35653567
}
35663568

35673569
StringBuffer path(directory);

0 commit comments

Comments
 (0)