Explorar el Código

HPCC-14191 Configgen should report thormaster ports

Signed-off-by: Gleb Aronsky <gleb.aronsky@lexisnexis.com>
Gleb Aronsky hace 9 años
padre
commit
1c8fb34c4a

+ 12 - 1
deployment/configgen/main.cpp

@@ -21,6 +21,7 @@
 #include "build-config.h"
 #include "jutil.hpp"
 #include "jhash.ipp"
+#include "portlist.h"
 
 #define STANDARD_INDIR COMPONENTFILES_DIR"/configxml"
 #define STANDARD_OUTDIR RUNTIME_DIR
@@ -692,7 +693,17 @@ int processRequest(const char* in_cfgname, const char* out_dirname, const char*
               continue;
 
             netAddr.clear().append(pInst->queryProp("@netAddress"));
-            port.clear().append(pInst->queryProp("@port"));
+            port.clear();
+
+            if (strcmp(pInst->queryName(), XML_TAG_THORMASTERPROCESS) == 0)
+            {
+                if (pInst->queryProp(XML_ATTR_MASTERPORT) == NULL || (pInst->queryProp(XML_ATTR_MASTERPORT))[0] == 0)
+                    port.append(THOR_BASE_PORT);
+                else
+                    port.append(pInst->queryProp(XML_ATTR_MASTERPORT));
+            }
+	    else
+		port.append(pInst->queryProp("@port"));
             
             if (multiInstances)
               processName.clear().append(pInst->queryName());

+ 1 - 0
deployment/deploy/XMLTags.h

@@ -163,6 +163,7 @@
 #define XML_ATTR_LOGSQL                "@logSQL"
 #define XML_ATTR_MANUFACTURER          "@manufacturer"
 #define XML_ATTR_MASK                  "@mask"
+#define XML_ATTR_MASTERPORT            "@masterport"
 #define XML_ATTR_MAXOCCURS             "@maxOccurs"
 #define XML_ATTR_MEMORY                "@memory"
 #define XML_ATTR_MINIMALLOGGING        "@minimalLogging"

+ 2 - 0
deployment/deploy/deploy.cpp

@@ -1151,6 +1151,7 @@ IPropertyTree* getInstances(const IPropertyTree* pEnvRoot, const char* compName,
       const char* name    = pComponent->queryProp("@name");
       const char* build   = pComponent->queryProp("@build");
       const char* buildSet= pComponent->queryProp("@buildSet");
+      const char* masterPort = pComponent->queryProp("@masterport");
       const char* logDir = NULL;
 
       if ((!strcmp(buildSet,"thor") || !strcmp(buildSet,"roxie")) && !pTopologyComponents.contains(name))
@@ -1212,6 +1213,7 @@ IPropertyTree* getInstances(const IPropertyTree* pEnvRoot, const char* compName,
                 pInstance->addProp("@name", pInst->queryProp("@name"));
                 pInstance->addProp("@computer", computer);
                 pInstance->addProp("@netAddress", netAddr);
+                pInstance->addProp("@masterport", masterPort);
               }
             }
           }

+ 1 - 1
initfiles/componentfiles/configxml/thor.xsd.in

@@ -462,7 +462,7 @@
           </xs:appinfo>
         </xs:annotation>
       </xs:attribute>
-      <xs:attribute name="masterport" type="xs:nonNegativeInteger" use="optional">
+      <xs:attribute name="masterport" type="xs:nonNegativeInteger" default="20000">
         <xs:annotation>
           <xs:appinfo>
             <tooltip>Base port to use for master</tooltip>