Explorar el Código

HPCC-27285 Report correct roxie queue in WsSMC/WsPackageProcess

1. The WsSAMC.Activity response, remove the "publish-only" roxie
queues.
2. The WsPackageProcess.GetPackageMapSelectOptions should only
report the roxie queues which support query publish.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx hace 3 años
padre
commit
11ff49d56d

+ 5 - 0
common/environment/environment.cpp

@@ -2839,6 +2839,11 @@ public:
     {
         return ldapPassword.str();
     }
+    bool isQueriesOnly() const
+    {
+        //In bare metal environment, roxie is not QueriesOnly.
+        return false;
+    }
 };
 
 IStringVal &getProcessQueueNames(IStringVal &ret, const char *process, const char *type, const char *suffix)

+ 1 - 0
common/environment/environment.hpp

@@ -274,6 +274,7 @@ interface IConstWUClusterInfo : extends IInterface
     virtual unsigned getChannelsPerNode() const = 0;
     virtual int getRoxieReplicateOffset() const = 0;
     virtual const char *getAlias() const = 0;
+    virtual bool isQueriesOnly() const = 0;
 };
 
 typedef IArrayOf<IConstWUClusterInfo> CConstWUClusterInfoArray;

+ 19 - 39
esp/services/ws_packageprocess/ws_packageprocessService.cpp

@@ -1271,50 +1271,30 @@ bool CWsPackageProcessEx::onGetPackageMapSelectOptions(IEspContext &context, IEs
             getWUClusterInfo(clusters);
             ForEachItemIn(c, clusters)
             {
-                SCMStringBuffer str;
                 IConstWUClusterInfo &cluster = clusters.item(c);
-                Owned<IEspTargetData> target = createTargetData("", "");
-                target->setName(cluster.getName(str).str());
-                ClusterType clusterType = cluster.getPlatform();
-                if (clusterType == ThorLCRCluster)
-                    target->setType(THORCLUSTER);
-                else if (clusterType == RoxieCluster)
-                    target->setType(ROXIECLUSTER);
-                else
-                    target->setType(HTHORCLUSTER);
-                if (!includeProcesses)
-                {
-                    targets.append(*target.getClear());
-                    continue;
-                }
-                StringArray processes;
-                if (clusterType == ThorLCRCluster)
+#ifndef _CONTAINERIZED
+                if (cluster.getPlatform() == RoxieCluster)
+#else
+                if ((cluster.getPlatform() == RoxieCluster) && cluster.isQueriesOnly())
+#endif
                 {
-                    const StringArray &thors = cluster.getThorProcesses();
-                    ForEachItemIn(i, thors)
+                    SCMStringBuffer str;
+                    Owned<IEspTargetData> target = createTargetData();
+                    target->setName(cluster.getName(str).str());
+                    target->setType(ROXIECLUSTER);
+                    if (includeProcesses)
                     {
-                        const char* process = thors.item(i);
-                        if (process && *process)
-                            processes.append(process);
+                        SCMStringBuffer process;
+                        cluster.getRoxieProcess(process);
+                        if (process.length())
+                        {
+                            StringArray processes;
+                            processes.append(process.str());
+                            target->setProcesses(processes);
+                        }
                     }
+                    targets.append(*target.getClear());
                 }
-                else if (clusterType == RoxieCluster)
-                {
-                    SCMStringBuffer process;
-                    cluster.getRoxieProcess(process);
-                    if (process.length())
-                        processes.append(process.str());
-                }
-                else if (clusterType == HThorCluster)
-                {
-                    SCMStringBuffer process;
-                    cluster.getAgentQueue(process);
-                    if (process.length())
-                        processes.append(process.str());
-                }
-                if (processes.length())
-                    target->setProcesses(processes);
-                targets.append(*target.getClear());
             }
             resp.setTargets(targets);
         }

+ 3 - 0
esp/services/ws_smc/ws_smcService.cpp

@@ -282,6 +282,9 @@ void CActivityInfo::readTargetClusterInfo(CConstWUClusterInfoArray& clusters, IP
     ForEachItemIn(c, clusters)
     {
         IConstWUClusterInfo &cluster = clusters.item(c);
+        if (cluster.isQueriesOnly()) //"publish-only" roxie queues not in SDS /JobQueues.
+            continue;
+
         Owned<CWsSMCTargetCluster> targetCluster = new CWsSMCTargetCluster();
         readTargetClusterInfo(cluster, serverStatusRoot, targetCluster);
         if (cluster.getPlatform() == ThorLCRCluster)

+ 9 - 4
esp/smc/SMCLib/TpContainer.cpp

@@ -496,10 +496,11 @@ class CContainerWUClusterInfo : public CSimpleInterfaceOf<IConstWUClusterInfo>
     ClusterType platform;
     unsigned clusterWidth;
     StringArray thorProcesses;
+    bool queriesOnly = false;
 
 public:
-    CContainerWUClusterInfo(const char* _name, const char* type, unsigned _clusterWidth)
-        : name(_name), clusterWidth(_clusterWidth)
+    CContainerWUClusterInfo(const char* _name, const char* type, unsigned _clusterWidth, bool _queriesOnly)
+        : name(_name), clusterWidth(_clusterWidth), queriesOnly(_queriesOnly)
     {
         StringBuffer queue;
         if (strieq(type, "thor"))
@@ -554,6 +555,10 @@ public:
     {
         return false;
     }
+    virtual bool isQueriesOnly() const override
+    {
+        return queriesOnly;
+    }
     virtual IStringVal& getScope(IStringVal& str) const override
     {
         UNIMPLEMENTED;
@@ -624,7 +629,7 @@ extern TPWRAPPER_API unsigned getContainerWUClusterInfo(CConstWUClusterInfoArray
     {
         IPropertyTree& queue = queues->query();
         Owned<IConstWUClusterInfo> cluster = new CContainerWUClusterInfo(queue.queryProp("@name"),
-            queue.queryProp("@type"), (unsigned) queue.getPropInt("@width", 1));
+            queue.queryProp("@type"), (unsigned) queue.getPropInt("@width", 1), queue.getPropBool("@queriesOnly"));
         clusters.append(*cluster.getClear());
     }
 
@@ -649,7 +654,7 @@ extern TPWRAPPER_API IConstWUClusterInfo* getWUClusterInfoByName(const char* clu
         return nullptr;
 
     return new CContainerWUClusterInfo(queue->queryProp("@name"), queue->queryProp("@type"),
-        (unsigned) queue->getPropInt("@width", 1));
+        (unsigned) queue->getPropInt("@width", 1), queue->getPropBool("@queriesOnly"));
 }
 
 extern TPWRAPPER_API void initContainerRoxieTargets(MapStringToMyClass<ISmartSocketFactory>& connMap)

+ 5 - 0
esp/smc/SMCLib/TpWrapper.cpp

@@ -1945,6 +1945,11 @@ public:
         str.set(name.get());
         return str;
     }
+    virtual bool isQueriesOnly() const override
+    {
+        //In bare metal environment, roxie is not QueriesOnly.
+        return false;
+    }
     virtual const StringArray & getThorProcesses() const override
     {
         return thorProcesses;