Selaa lähdekoodia

Merge pull request #11167 from wangkx/h17684

HPCC-19689 Add IncludeTotalClusterTime option to WUInfo request

Reviewed-By: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 vuotta sitten
vanhempi
commit
a3ab222376

+ 2 - 1
esp/scm/ws_workunits.ecm

@@ -821,6 +821,7 @@ ESPrequest WUInfoRequest
     [min_ver("1.66")] bool IncludeECL(true);
     [min_ver("1.66")] bool IncludeHelpers(true);
     [min_ver("1.66")] bool IncludeAllowedClusters(true);
+    [min_ver("1.73")] bool IncludeTotalClusterTime(true);
     [min_ver("1.16")] bool SuppressResultSchemas(false);
     [min_ver("1.25")] string ThorSlaveIP;
 };
@@ -2224,7 +2225,7 @@ ESPresponse [exceptions_inline] WUEclDefinitionActionResponse
 // ----------------------------------------------------------------------------------
 ESPservice [
     auth_feature("DEFERRED"), //This declares that the method logic handles feature level authorization
-    version("1.72"), default_client_version("1.72"),
+    version("1.73"), default_client_version("1.73"),
     noforms,exceptions_inline("./smc_xslt/exceptions.xslt"),use_method_name] WsWorkunits
 {
     ESPmethod [cache_seconds(60), resp_xsl_default("/esp/xslt/workunits.xslt")]     WUQuery(WUQueryRequest, WUQueryResponse);

+ 3 - 1
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -948,7 +948,9 @@ void WsWuInfo::getCommon(IEspECLWorkunit &info, unsigned long flags)
 
     getEventScheduleFlag(info);
 
-    if (version > 1.27)
+    //The TotalClusterTime should always be returned between versions 1.27 and 1.73.
+    //After version 1.73, it should be returned only if IncludeTotalClusterTime is true.
+    if ((version > 1.27) && ((version < 1.73) || (flags & WUINFO_IncludeTotalClusterTime)))
     {
         unsigned totalThorTimeMS = getTotalThorTime();
         if (totalThorTimeMS)

+ 1 - 0
esp/services/ws_workunits/ws_workunitsHelpers.hpp

@@ -128,6 +128,7 @@ private:
 #define WUINFO_IncludeECL               0x4000
 #define WUINFO_IncludeHelpers           0x8000
 #define WUINFO_IncludeAllowedClusters   0x10000
+#define WUINFO_IncludeTotalClusterTime  0x20000
 #define WUINFO_All                      0xFFFFFFFF
 
 class WsWuInfo

+ 2 - 0
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -1568,6 +1568,8 @@ bool CWsWorkunitsEx::onWUInfo(IEspContext &context, IEspWUInfoRequest &req, IEsp
                     flags|=WUINFO_IncludeHelpers;
                 if (req.getIncludeAllowedClusters())
                     flags|=WUINFO_IncludeAllowedClusters;
+                if (req.getIncludeTotalClusterTime())
+                    flags|=WUINFO_IncludeTotalClusterTime;
 
                 WsWuInfo winfo(context, wuid.str());
                 winfo.getInfo(resp.updateWorkunit(), flags);