Browse Source

Merge pull request #15280 from wangkx/h25279

HPCC-25279 Fix '#ifdef _CONTAINERIZED's in ESP FileSpray/WsWorkunits

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 years ago
parent
commit
e880ff9dc9

+ 0 - 4
esp/services/ws_fs/ws_fsBinding.cpp

@@ -202,9 +202,6 @@ int CFileSpraySoapBindingEx::onGetInstantQuery(IEspContext &context, CHttpReques
 IPropertyTree* CFileSpraySoapBindingEx::createPTreeForXslt(double clientVersion, const char* method, const char* dfuwuid)
 {
     Owned<IPropertyTree> pRoot = createPTreeFromXMLString("<Environment/>");
-#ifdef _CONTAINERIZED
-    IERRLOG("CONTAINERIZED(CFileSpraySoapBindingEx::createPTreeForXslt)");
-#else
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
     Owned<IConstEnvironment> constEnv = factory->openEnvironment();
     Owned<IPropertyTree> pEnvRoot = &constEnv->getPTree();
@@ -301,7 +298,6 @@ IPropertyTree* CFileSpraySoapBindingEx::createPTreeForXslt(double clientVersion,
         if (wuxml.length() > 0)
             pSoftware->addPropTree("DfuWorkunit", createPTreeFromXMLString(wuxml.str()));
     }
-#endif
     return pRoot.getClear();
 }
 

+ 2 - 3
esp/services/ws_fs/ws_fsService.cpp

@@ -679,9 +679,8 @@ bool CFileSprayEx::onDFUWUSearch(IEspContext &context, IEspDFUWUSearchRequest &
 {
     try
     {
-#ifdef _CONTAINERIZED
-        UNIMPLEMENTED_X("CONTAINERIZED(CFileSprayEx::onDFUWUSearch)");
-#else
+#ifndef _CONTAINERIZED
+        //The code below should be only for legacy ECLWatch.
         context.ensureFeatureAccess(DFU_WU_URL, SecAccess_Read, ECLWATCH_DFU_WU_ACCESS_DENIED, "Access to DFU workunit is denied.");
 
         Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);

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

@@ -1072,10 +1072,6 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
     IArrayOf<IConstThorLogInfo> thorLogList;
     if (cw->getWuidVersion() > 0)
     {
-#ifdef _CONTAINERIZED
-        IERRLOG("CONTAINERIZED(WsWuInfo::getWorkunitThorLogInfo) not fully implemented");
-        return countThorLog;
-#else
         StringAttr clusterName(cw->queryClusterName());
         if (!clusterName.length()) //Cluster name may not be set yet
             return countThorLog;
@@ -1161,14 +1157,9 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
                 thorLogList.append(*thorLog.getLink());
             }
         }
-#endif
     }
     else //legacy wuid
     {
-#ifdef _CONTAINERIZED
-        IERRLOG("CONTAINERIZED(WsWuInfo::getWorkunitThorLogInfo) not fully implemented");
-        return countThorLog;
-#else
         Owned<IStringIterator> thorLogs = cw->getLogs("Thor");
         ForEach (*thorLogs)
         {
@@ -1252,7 +1243,6 @@ unsigned WsWuInfo::getWorkunitThorLogInfo(IArrayOf<IEspECLHelpFile>& helpers, IE
                 thorLogList.append(*thorLog.getLink());
             }
         }
-#endif
     }
 
     if (thorLogList.length() > 0)
@@ -2054,9 +2044,6 @@ void WsWuInfo::getWorkunitThorSlaveLog(IPropertyTree* directories, const char *p
     const char* instanceName, const char *ipAddress, const char* logDate, int slaveNum,
     MemoryBuffer& buf, const char* outFile, bool forDownload)
 {
-#ifdef _CONTAINERIZED
-    UNIMPLEMENTED_X("CONTAINERIZED(WsWuInfo::getWorkunitThorLogInfo)");
-#else
     StringBuffer logDir, groupName;
     getConfigurationDirectory(directories, "log", "thor", process, logDir);
     getClusterThorGroupName(groupName, instanceName);
@@ -2068,7 +2055,6 @@ void WsWuInfo::getWorkunitThorSlaveLog(IPropertyTree* directories, const char *p
         throw MakeStringException(ECLWATCH_INVALID_INPUT, "Node group %s not found", groupName.str());
 
     getWorkunitThorSlaveLog(nodeGroup, ipAddress, process, logDate, logDir.str(), slaveNum, buf, outFile, forDownload);
-#endif
 }
 
 void WsWuInfo::readWorkunitThorLog(const char* processName, const char* log, const char* slaveIPAddress, unsigned slaveNum, MemoryBuffer& buf, const char* outFile)
@@ -3555,10 +3541,7 @@ void CWsWuFileHelper::createThorSlaveLogfile(IConstWorkUnit* cwu, WsWuInfo& winf
     const char* clusterName = cwu->queryClusterName();
     if (isEmptyString(clusterName)) //Cluster name may not be set yet
         return;
-#ifdef _CONTAINERIZED
-    UNIMPLEMENTED_X("CONTAINERIZED(CWsWuFileHelper::createThorSlaveLogfile)");
-    return;
-#else
+
     Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(clusterName);
     if (!clusterInfo)
     {
@@ -3604,7 +3587,6 @@ void CWsWuFileHelper::createThorSlaveLogfile(IConstWorkUnit* cwu, WsWuInfo& winf
         }
     }
     threadPool->joinAll();
-#endif
 }
 #endif
 

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

@@ -4407,9 +4407,6 @@ int CWsWorkunitsSoapBindingEx::onGetForm(IEspContext &context, CHttpRequest* req
         {
             if(strieq(method,"WUQuery"))
             {
-#ifdef _CONTAINERIZED
-                UNIMPLEMENTED_X("CONTAINERIZED(CWsWorkunitsSoapBindingEx::onGetForm)");
-#else
                 Owned<IEnvironmentFactory> factory = getEnvironmentFactory(true);
                 Owned<IConstEnvironment> environment = factory->openEnvironment();
                 Owned<IPropertyTree> root = &environment->getPTree();
@@ -4439,7 +4436,6 @@ int CWsWorkunitsSoapBindingEx::onGetForm(IEspContext &context, CHttpRequest* req
                 }
                 xml.append("</WUQuery>");
                 xslt.append(getCFD()).append("./smc_xslt/wuid_search.xslt");
-#endif
             }
             else if (strieq(method,"WUJobList"))
             {