Browse Source

Merge pull request #11153 from shamser/issue19661

HPCC-19661 WUDetail's AllProperties and AllAttributes option changes

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 7 years ago
parent
commit
7a1c3d880e

+ 3 - 3
esp/scm/ws_workunits.ecm

@@ -2079,9 +2079,10 @@ ESPStruct WUExtraProperties
 ESPStruct WUPropertiesToReturn
 {
     bool AllStatistics(false);
-    bool AllProperties(false);
+    bool AllAttributes(false);
     bool AllHints(false);
     bool AllScopes(false);
+    bool AllProperties(false);
     [optional] uint64 MinVersion;       // Only return properties where the version is later than this version.
     [optional] string Measure;          // E.g. Time, Num, Size
     [optional] ESParray<string, Property> Properties; // a list of properties to return
@@ -2153,8 +2154,7 @@ ESPRequest WUDetailsMetaRequest
 
 ESPResponse [exceptions_inline] WUDetailsMetaResponse
 {
-    ESParray<string, Statistic> Statistics;
-    ESParray<string, Attribute> Attributes;
+    ESParray<string, Property> Properties;
     ESParray<string, ScopeType> ScopeTypes;
     ESParray<string, Measure> Measures;
 };

+ 4 - 6
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -4014,23 +4014,21 @@ bool CWsWorkunitsEx::onWUDetailsMeta(IEspContext &context, IEspWUDetailsMetaRequ
 {
     try
     {
-        StringArray statistics;
+        StringArray properties;
         for (unsigned i=StatisticKind::StKindAll+1; i<StatisticKind::StMax;++i)
         {
             const char * s = queryStatisticName((StatisticKind)i);
             if (s && *s)
-                statistics.append(s);
+                properties.append(s);
         }
-        resp.setStatistics(statistics);
 
-        StringArray attributes;
         for (unsigned i=WuAttr::WaAll+1; i<WuAttr::WaMax; ++i)
         {
             const char * s = queryWuAttributeName((WuAttr)i);
             if (s && *s)
-                attributes.append(s);
+                properties.append(s);
         }
-        resp.setAttributes(attributes);
+        resp.setProperties(properties);
 
         StringArray scopeTypes;
         for (unsigned i=StatisticScopeType::SSTall+1; i<StatisticScopeType::SSTmax; ++i)

+ 20 - 10
esp/services/ws_workunits/ws_wudetails.cpp

@@ -164,8 +164,9 @@ void WUDetailsVisitor::noteHint(const char * kind, const char * value)
 void WUDetailsVisitor::buildAttribListToReturn(IConstWUPropertiesToReturn & propertiesToReturn)
 {
     const bool allStatistics = propertiesToReturn.getAllStatistics();
-    const bool allProperties = propertiesToReturn.getAllProperties();
-    if (allStatistics && allProperties)
+    const bool allAttributes = propertiesToReturn.getAllAttributes();
+
+    if (propertiesToReturn.getAllProperties() || (allStatistics && allAttributes) )
         return;
 
     IArrayOf<IConstWUExtraProperties> & extraProperties = propertiesToReturn.getExtraProperties();
@@ -199,7 +200,7 @@ void WUDetailsVisitor::buildAttribListToReturn(IConstWUPropertiesToReturn & prop
                 const WuAttr wa = queryWuAttribute(props[idx2], WaMax);
                 if (wa==WaMax)
                     throw MakeStringException(ECLWATCH_INVALID_INPUT, "Invalid property name (%s) in ExtraProperties",props[idx2]);
-                if (!allProperties)
+                if (!allAttributes)
                 {
                     extraAttributes[sst].insert(wa);
                     extraAttributesRequested = true;
@@ -379,14 +380,23 @@ void WUDetails::buildWuScopeFilter(IConstWUScopeFilter & requestScopeFilter, ICo
         }
     }
 
-    if (propertiesToReturn.getAllStatistics())
-        wuScopeFilter.addOutputProperties(PTstatistics);
+    WuPropertyTypes wuPropertyTypeMask = PTnone;
     if (propertiesToReturn.getAllProperties())
-        wuScopeFilter.addOutputProperties(PTattributes);
-    if (propertiesToReturn.getAllHints())
-        wuScopeFilter.addOutputProperties(PThints);
-    if (propertiesToReturn.getAllScopes())
-        wuScopeFilter.addOutputProperties(PTscope);
+    {
+        wuPropertyTypeMask = PTall;
+    }
+    else
+    {
+        if (propertiesToReturn.getAllStatistics())
+            wuPropertyTypeMask |= PTstatistics;
+        if (propertiesToReturn.getAllAttributes())
+            wuPropertyTypeMask |= PTattributes;
+        if (propertiesToReturn.getAllHints())
+            wuPropertyTypeMask |= PThints;
+        if (propertiesToReturn.getAllScopes())
+            wuPropertyTypeMask |= PTscope;
+    }
+    wuScopeFilter.addOutputProperties(wuPropertyTypeMask);
 
     wuScopeFilter.finishedFilter();
 }