Skip to content

Commit 220ee22

Browse files
committed
Merge remote-tracking branch 'origin/candidate-9.6.x' into candidate-9.8.x
2 parents b16bd33 + abb4d7b commit 220ee22

32 files changed

+650
-301
lines changed

dali/ft/filecopy.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -3429,7 +3429,9 @@ void FileSprayer::spray()
34293429

34303430
//If got here then we have succeeded
34313431
//Note: On failure, costs will not be updated. Future: would be useful to have a way to update costs on failure.
3432-
updateTargetProperties();
3432+
cost_type totalWriteCost = updateTargetProperties();
3433+
cost_type totalReadCost = updateSourceProperties();
3434+
progressReport->setFileAccessCost(totalReadCost+totalWriteCost);
34333435

34343436
StringBuffer copyEventText; // [logical-source] > [logical-target]
34353437
if (distributedSource)
@@ -3479,13 +3481,13 @@ bool FileSprayer::isSameSizeHeaderFooter()
34793481
return retVal;
34803482
}
34813483

3482-
void FileSprayer::updateTargetProperties()
3484+
cost_type FileSprayer::updateTargetProperties()
34833485
{
34843486
TimeSection timer("FileSprayer::updateTargetProperties() time");
34853487
Owned<IException> error;
3486-
cost_type totalWriteCost = 0;
34873488
if (distributedTarget)
34883489
{
3490+
cost_type totalWriteCost = 0;
34893491
StringBuffer failedParts;
34903492
CRC32Merger partCRC;
34913493
offset_t partLength = 0;
@@ -3836,12 +3838,20 @@ void FileSprayer::updateTargetProperties()
38363838
int expireDays = options->getPropInt("@expireDays", -1);
38373839
if (expireDays != -1)
38383840
curProps.setPropInt("@expireDays", expireDays);
3841+
return totalWriteCost;
38393842
}
3843+
if (error)
3844+
throw error.getClear();
3845+
return 0;
3846+
}
3847+
3848+
cost_type FileSprayer::updateSourceProperties()
3849+
{
3850+
TimeSection timer("FileSprayer::updateSourceProperties() time");
38403851
// Update file readCost and numReads in file properties and do the same for subfiles
3841-
// Update totalReadCost
3842-
cost_type totalReadCost = 0;
38433852
if (distributedSource)
38443853
{
3854+
cost_type totalReadCost = 0;
38453855
IDistributedSuperFile * superSrc = distributedSource->querySuperFile();
38463856
if (superSrc && superSrc->numSubFiles() > 0)
38473857
{
@@ -3866,14 +3876,10 @@ void FileSprayer::updateTargetProperties()
38663876
// so query the first (and only) subfile
38673877
subfile = &superSrc->querySubFile(0);
38683878
}
3869-
DistributedFilePropertyLock lock(subfile);
3870-
IPropertyTree &subFileProps = lock.queryAttributes();
3871-
stat_type prevNumReads = subFileProps.getPropInt64(getDFUQResultFieldName(DFUQRFnumDiskReads), 0);
3872-
cost_type legacyReadCost = getLegacyReadCost(subfile->queryAttributes(), subfile);
3873-
cost_type prevReadCost = subFileProps.getPropInt64(getDFUQResultFieldName(DFUQRFreadCost), 0);
38743879
cost_type curReadCost = calcFileAccessCost(subfile, 0, curProgress.numReads);
3875-
subFileProps.setPropInt64(getDFUQResultFieldName(DFUQRFnumDiskReads), prevNumReads + curProgress.numReads);
3876-
subFileProps.setPropInt64(getDFUQResultFieldName(DFUQRFreadCost), legacyReadCost + prevReadCost + curReadCost);
3880+
subfile->addAttrValue(getDFUQResultFieldName(DFUQRFnumDiskReads), curProgress.numReads);
3881+
cost_type legacyReadCost = getLegacyReadCost(subfile->queryAttributes(), subfile);
3882+
subfile->addAttrValue(getDFUQResultFieldName(DFUQRFreadCost), legacyReadCost + curReadCost);
38773883
totalReadCost += curReadCost;
38783884
}
38793885
else
@@ -3887,20 +3893,14 @@ void FileSprayer::updateTargetProperties()
38873893
{
38883894
totalReadCost = calcFileAccessCost(distributedSource, 0, totalNumReads);
38893895
}
3890-
DistributedFilePropertyLock lock(distributedSource);
3891-
IPropertyTree &curProps = lock.queryAttributes();
3892-
stat_type prevNumReads = curProps.getPropInt64(getDFUQResultFieldName(DFUQRFnumDiskReads), 0);
3893-
cost_type legacyReadCost = getLegacyReadCost(curProps, distributedSource);
3894-
cost_type prevReadCost = curProps.getPropInt64(getDFUQResultFieldName(DFUQRFreadCost), 0);
3895-
curProps.setPropInt64(getDFUQResultFieldName(DFUQRFnumDiskReads), prevNumReads + totalNumReads);
3896-
curProps.setPropInt64(getDFUQResultFieldName(DFUQRFreadCost), legacyReadCost + prevReadCost + totalReadCost);
3896+
distributedSource->addAttrValue(getDFUQResultFieldName(DFUQRFnumDiskReads), totalNumReads);
3897+
cost_type legacyReadCost = getLegacyReadCost(distributedSource->queryAttributes(), distributedSource);
3898+
distributedSource->addAttrValue(getDFUQResultFieldName(DFUQRFreadCost), legacyReadCost + totalReadCost);
3899+
return totalReadCost; // return the total cost of this file operation (exclude previous and legacy read costs)
38973900
}
3898-
progressReport->setFileAccessCost(totalReadCost+totalWriteCost);
3899-
if (error)
3900-
throw error.getClear();
3901+
return 0;
39013902
}
39023903

3903-
39043904
void FileSprayer::splitAndCollectFileInfo(IPropertyTree * newRecord, RemoteFilename &remoteFileName,
39053905
bool isDistributedSource)
39063906
{

dali/ft/filecopy.ipp

+2-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ protected:
271271
void savePartition();
272272
void setCopyCompressedRaw();
273273
void setSource(IFileDescriptor * source, unsigned copy, unsigned mirrorCopy = (unsigned)-1);
274-
void updateTargetProperties();
274+
cost_type updateTargetProperties();
275+
cost_type updateSourceProperties();
275276
bool usePullOperation() const;
276277
bool usePushOperation() const;
277278
bool usePushWholeOperation() const;

ecl/hqlcpp/hqlckey.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,22 @@ IHqlExpression * KeyedJoinInfo::querySimplifiedKey(IHqlExpression * expr)
305305
}
306306
}
307307

308+
IHqlExpression * queryBaseIndexForKeyedJoin(IHqlExpression * expr)
309+
{
310+
if (expr->getOperator() == no_if)
311+
{
312+
IHqlExpression * left = queryBaseIndexForKeyedJoin(expr->queryChild(1));
313+
IHqlExpression * right = queryBaseIndexForKeyedJoin(expr->queryChild(2));
314+
if (left && right)
315+
return left;
316+
return nullptr;
317+
}
318+
return queryPhysicalRootTable(expr);
319+
}
320+
308321
IHqlExpression * KeyedJoinInfo::createKeyFromComplexKey(IHqlExpression * expr)
309322
{
310-
IHqlExpression * base = queryPhysicalRootTable(expr);
323+
IHqlExpression * base = queryBaseIndexForKeyedJoin(expr);
311324
if (!base)
312325
{
313326
translator.throwError1(HQLERR_KeyedJoinNoRightIndex_X, getOpString(expr->getOperator()));
@@ -1234,7 +1247,7 @@ void HqlCppTranslator::buildKeyJoinIndexReadHelper(ActivityInstance & instance,
12341247
buildFilenameFunction(instance, instance.startctx, WaIndexname, "getIndexFileName", info->queryKeyFilename(), hasDynamicFilename(info->queryKey()), SummaryType::ReadIndex, info->isKeyOpt(), info->isKeySigned());
12351248

12361249
//virtual IOutputMetaData * queryIndexRecordSize() = 0;
1237-
LinkedHqlExpr indexExpr = info->queryOriginalKey();
1250+
LinkedHqlExpr indexExpr = info->queryKey();
12381251
OwnedHqlExpr serializedRecord;
12391252
unsigned numPayload = numPayloadFields(indexExpr);
12401253
if (numPayload)

esp/src/eclwatch/ClusterProcessesQueryWidget.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ define([
22
"dojo/_base/declare",
33
"src/nlsHPCC",
44
"dojo/topic",
5+
"dojo/dom-construct",
56

67
"dijit/registry",
78

@@ -20,7 +21,7 @@ define([
2021
"hpcc/IFrameWidget",
2122

2223
"dijit/Dialog",
23-
], function (declare, nlsHPCCMod, topic,
24+
], function (declare, nlsHPCCMod, topic, domConstruct,
2425
registry,
2526
tree, selector,
2627
GridDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, ESPUtil, DelayLoadWidget, PreflightDetailsWidget, MachineInformationWidget, IFrameWidget) {
@@ -50,6 +51,10 @@ define([
5051
style: "border: 0; width: 100%; height: 100%"
5152
});
5253
this.legacyClustersProcessesIframeWidget.placeAt(this._tabContainer, "last");
54+
if (dojoConfig.isContainer) {
55+
const legacyTab = registry.byId(this.id + "_LegacyClustersProcessesIframeWidget");
56+
legacyTab.set("disabled", true);
57+
}
5358
},
5459

5560
init: function (params) {
@@ -85,9 +90,15 @@ define([
8590
if (currSel.id === this.id + "_Grid") {
8691
this.refreshGrid();
8792
} else if (currSel.id === this.legacyClustersProcessesIframeWidget.id && !this.legacyClustersProcessesIframeWidget.initalized) {
88-
this.legacyClustersProcessesIframeWidget.init({
89-
src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT"
90-
});
93+
if (!dojoConfig.isContainer) {
94+
this.legacyClustersProcessesIframeWidget.init({
95+
src: ESPRequest.getBaseURL("WsTopology") + "/TpClusterQuery?Type=ROOT"
96+
});
97+
} else {
98+
const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } });
99+
unavailMsg.innerText = this.i18n.UnavailableInContainerized;
100+
this.legacyClustersProcessesIframeWidget.contentPane.set("content", unavailMsg);
101+
}
91102
} else {
92103
currSel.init(currSel.params);
93104
}

esp/src/eclwatch/SystemServersQueryWidget.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ define([
44
"dojo/_base/array",
55
"dojo/dom-class",
66
"dojo/topic",
7+
"dojo/dom-construct",
78

89
"dijit/registry",
910
"dijit/Dialog",
@@ -21,7 +22,7 @@ define([
2122
"hpcc/PreflightDetailsWidget",
2223
"hpcc/MachineInformationWidget",
2324
"hpcc/IFrameWidget"
24-
], function (declare, nlsHPCCMod, arrayUtil, domClass, topic,
25+
], function (declare, nlsHPCCMod, arrayUtil, domClass, topic, domConstruct,
2526
registry, Dialog,
2627
tree, selector,
2728
GridDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, ESPUtil, DelayLoadWidget, PreflightDetailsWidget, MachineInformationWidget, IFrameWidget) {
@@ -71,9 +72,15 @@ define([
7172
if (currSel.id === this.id + "_Grid") {
7273
this.refreshGrid();
7374
} else if (currSel.id === this.systemServersQueryWidgetIframeWidget.id && !this.systemServersQueryWidgetIframeWidget.initalized) {
74-
this.systemServersQueryWidgetIframeWidget.init({
75-
src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES"
76-
});
75+
if (!dojoConfig.isContainer) {
76+
this.systemServersQueryWidgetIframeWidget.init({
77+
src: ESPRequest.getBaseURL("WsTopology") + "/TpServiceQuery?Type=ALLSERVICES"
78+
});
79+
} else {
80+
const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } });
81+
unavailMsg.innerText = this.i18n.UnavailableInContainerized;
82+
this.systemServersQueryWidgetIframeWidget.contentPane.set("content", unavailMsg);
83+
}
7784
} else {
7885
currSel.init(currSel.params);
7986
}
@@ -139,6 +146,10 @@ define([
139146
style: "border: 0; width: 100%; height: 100%"
140147
});
141148
this.systemServersQueryWidgetIframeWidget.placeAt(this._tabContainer, "last");
149+
if (dojoConfig.isContainer) {
150+
const legacyTab = registry.byId(this.id + "_SystemServersQueryWidgetIframeWidget");
151+
legacyTab.set("disabled", true);
152+
}
142153
},
143154

144155
createGrid: function (domID) {

esp/src/eclwatch/TargetClustersQueryWidget.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ define([
22
"dojo/_base/declare",
33
"src/nlsHPCC",
44
"dojo/topic",
5+
"dojo/dom-construct",
56

67
"dijit/registry",
78

@@ -20,7 +21,7 @@ define([
2021
"hpcc/IFrameWidget",
2122

2223
"dijit/Dialog",
23-
], function (declare, nlsHPCCMod, topic,
24+
], function (declare, nlsHPCCMod, topic, domConstruct,
2425
registry,
2526
tree, selector,
2627
GridDetailsWidget, PreflightDetailsWidget, ESPPreflight, ESPRequest, WsTopology, Utility, DelayLoadWidget, ESPUtil, MachineInformationWidget, IFrameWidget) {
@@ -61,9 +62,15 @@ define([
6162
if (currSel.id === this.id + "_Grid") {
6263
this.refreshGrid();
6364
} else if (currSel.id === this.legacyTargetClustersIframeWidget.id && !this.legacyTargetClustersIframeWidget.initalized) {
64-
this.legacyTargetClustersIframeWidget.init({
65-
src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT"
66-
});
65+
if (!dojoConfig.isContainer) {
66+
this.legacyTargetClustersIframeWidget.init({
67+
src: ESPRequest.getBaseURL("WsTopology") + "/TpTargetClusterQuery?Type=ROOT"
68+
});
69+
} else {
70+
const unavailMsg = domConstruct.create("div", { style: { margin: "5px" } });
71+
unavailMsg.innerText = this.i18n.UnavailableInContainerized;
72+
this.legacyTargetClustersIframeWidget.contentPane.set("content", unavailMsg);
73+
}
6774
} else if (currSel.params.newPreflight || currSel.params.Usergenerated) { //prevents loop of pfTab.init above
6875
currSel.init(currSel.params);
6976
}
@@ -88,6 +95,10 @@ define([
8895
style: "border: 0; width: 100%; height: 100%"
8996
});
9097
this.legacyTargetClustersIframeWidget.placeAt(this._tabContainer, "last");
98+
if (dojoConfig.isContainer) {
99+
const legacyTab = registry.byId(this.id + "_LegacyTargetClustersIframeWidget");
100+
legacyTab.set("disabled", true);
101+
}
91102
this.machineFilter.disable();
92103
},
93104

esp/src/eclwatch/WUDetailsWidget.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ define([
161161
formatLogFilterDateTime: function (dateField, timeField, dateTimeField) {
162162
if (dateField.value.toString() !== "Invalid Date") {
163163
const d = new Date(dateField.value);
164-
const date = `${d.getFullYear()}-${(d.getMonth() < 9 ? "0" : "") + parseInt(d.getMonth() + 1, 10)}-${d.getDate()}`;
164+
const month = d.getMonth() + 1;
165+
const day = d.getDate();
166+
const date = `${d.getFullYear()}-${(month < 9 ? "0" : "") + month}-${(day < 9 ? "0" : "") + day}`;
165167
const time = timeField.value.toString().replace(/.*1970\s(\S+).*/, "$1");
166168
dateTimeField.value = `${date}T${time}.000Z`;
167169
}
Loading

esp/src/eclwatch/templates/WUDetailsWidget.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ <h2>
205205
<input id="${id}EndDateTime" name="LogFilter_AbsoluteTimeRange_EndDate" type="hidden" />
206206
<input id="${id}EndDate" title="${i18n.ToDate}:" name="EndDate" data-dojo-props="trim: true" required="required" data-dojo-type="dijit.form.DateTextBox" />
207207
<input id="${id}EndTime" title="" name="EndTime" data-dojo-props="trim: true" value="T19:30:00" data-dojo-type="dijit.form.TimeTextBox" />
208-
<input id="${id}RelativeTimeRangeBuffer" title="${i18n.RelativeTimeRange}" name="LogFilter_RelativeTimeRangeBuffer" colspan="2" data-dojo-type="dijit.form.TextBox" />
208+
<input id="${id}RelativeTimeRangeBuffer" title="${i18n.RelativeTimeRange}" name="LogFilter_RelativeTimeRangeBuffer" value="43200" colspan="2" data-dojo-type="dijit.form.TextBox" />
209209
<input id="${id}LineLimit" title="${i18n.LogLineLimit}" name="LogFilter_LineLimit" colspan="2" value="10000" data-dojo-type="dijit.form.TextBox" />
210210
<input id="${id}LineStartFrom" title="${i18n.LogLineStartFrom}" name="LogFilter_LineStartFrom" value="0" colspan="2" data-dojo-type="dijit.form.TextBox" />
211211
<select id="${id}SelectColumnMode" title="${i18n.ColumnMode}" name="LogFilter_SelectColumnMode" colspan="2" data-dojo-type="dijit.form.Select">

0 commit comments

Comments
 (0)