浏览代码

HPCC-13844 Lookup of topology processes and match instances

Signed-off-by: Michael Gardner <Michael.Gardner@lexisnexis.com>
Michael Gardner 10 年之前
父节点
当前提交
5eb8eff11c
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      deployment/deploy/deploy.cpp

+ 19 - 0
deployment/deploy/deploy.cpp

@@ -17,6 +17,7 @@
 #include "deploy.hpp"
 #include "environment.hpp"
 #include "jptree.hpp"
+#include "jarray.hpp"
 #include "jexcept.hpp"
 #include "jencrypt.hpp"
 #include "xslprocessor.hpp"
@@ -1117,6 +1118,21 @@ bool matchDeployAddress(const char *searchIP, const char *envIP)
 IPropertyTree* getInstances(const IPropertyTree* pEnvRoot, const char* compName, 
                             const char* compType, const char* ipAddr, bool listall)
 {
+  Owned<IPropertyTreeIterator> pClusterIter = pEnvRoot->getElements("Software/Topology/*");
+  StringArray pTopologyComponents;
+ 
+  ForEach(*pClusterIter)
+  {
+    IPropertyTree * pCluster = &pClusterIter->query();
+    IPropertyTreeIterator* pClusterProcessIter = pCluster->getElements("*");
+    ForEach(*pClusterProcessIter)
+    {
+      IPropertyTree * pClusterProcess = &pClusterProcessIter->query();
+      if (!strcmp(pClusterProcess->queryName(),"RoxieCluster") || !strcmp(pClusterProcess->queryName(),"ThorCluster"))
+        pTopologyComponents.appendUniq(pClusterProcess->queryProp("@process"));
+    }
+  }
+
   Owned<IPropertyTree> pSelComps(createPTree("SelectedComponents"));
   Owned<IPropertyTreeIterator> iter = pEnvRoot->getElements("Software/*");
   const char* instanceNodeNames[] = { "Instance", "RoxieServerProcess" };
@@ -1135,6 +1151,9 @@ IPropertyTree* getInstances(const IPropertyTree* pEnvRoot, const char* compName,
       const char* buildSet= pComponent->queryProp("@buildSet");
       const char* logDir = NULL;
 
+      if ((!strcmp(buildSet,"thor") || !strcmp(buildSet,"roxie")) && !pTopologyComponents.contains(name))
+        continue;
+
       if (listall)
         for (int i = 0; i < sizeof(logDirNames)/sizeof(char*); i++)
         {