Browse Source

HPCC-11228 Revise based on review

Signed-off-by: Kevin Wang kevin.wang@lexisnexis.com
Kevin Wang 11 years ago
parent
commit
4c2e83cc8f
3 changed files with 8 additions and 16 deletions
  1. 4 4
      dali/base/dadfs.cpp
  2. 2 0
      esp/services/ws_fs/CMakeLists.txt
  3. 2 12
      esp/services/ws_fs/ws_fsService.cpp

+ 4 - 4
dali/base/dadfs.cpp

@@ -11757,16 +11757,16 @@ IPropertyTreeIterator *deserializeFileAttrIterator(MemoryBuffer& mb, DFUQResultF
                 groups.appendListUniq(group, ",");
                 ForEachItemIn(i,groups)
                 {
-                    //Add a cluster if no cluster filter or the cluster matchs with cluster filter
+                    //Add a group if no group filter or the group matches with group filter
                     const char* node = groups.item(i);
                     if (node && *node && ((!nodeGroupFilter.length()) || (nodeGroupFilter.find(node) != NotFound)))
                         fileNodeGroups.append(node);
                 }
                 if (fileNodeGroups.length())
                 {
-                    //if this file exists on multiple clusters, set one of the clusters as the "@DFUSFcluster" prop for
-                    //this attr, leaving the rest inside the fileNodeGroups array. Those clusters will be used by the
-                    //duplicateFileAttrOnOtherClusterGroup() to duplicate this file attr on other clusters.
+                    //if this file exists on multiple groups, set one of the groups as the "@DFUSFnodegroup" prop for
+                    //this attr, leaving the rest inside the fileNodeGroups array. Those groups will be used by the
+                    //duplicateFileAttrOnOtherNodeGroup() to duplicate this file attr on other groups.
                     attr->setProp(getDFUQResultFieldName(DFUQRFnodegroup), fileNodeGroups.item(fileNodeGroups.length() -1));
                     fileNodeGroups.pop();
                 }

+ 2 - 0
esp/services/ws_fs/CMakeLists.txt

@@ -58,6 +58,7 @@ include_directories (
          ./../../smc/SMCLib 
          ./../../bindings/SOAP/xpp 
          ./../../../common/remote 
+         ./../../../common/workunit
     )
 
 ADD_DEFINITIONS( -D_USRDLL )
@@ -70,6 +71,7 @@ target_link_libraries ( ws_fs
          esphttp 
          dalibase 
          environment 
+         workunit
          SMCLib 
          dfuwu 
     )

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

@@ -26,6 +26,7 @@
 #include "daclient.hpp"
 #include "wshelpers.hpp"
 #include "dfuwu.hpp"
+#include "workunit.hpp"
 #include "ws_fsService.hpp"
 #ifdef _WIN32
 #include "windows.h"
@@ -616,18 +617,7 @@ void getNodeGroupFromLFN(const char* lfn, StringBuffer& nodeGroup, const char* u
     StringBuffer clusterName;
     LogicFileWrapper lfw;
     lfw.FindClusterName(lfn, clusterName, udesc);
-
-    Owned<IPropertyTreeIterator> it = conn->queryRoot()->getElements("Software/ThorCluster");
-    ForEach(*it)
-    {
-        IPropertyTree& cluster = it->query();
-        const char* name = cluster.queryProp("@name");
-        if (name && strieq(name, clusterName.str()))
-        {
-            getClusterGroupName(cluster, nodeGroup);
-            break;
-        }
-    }
+    getClusterThorGroupName(nodeGroup, clusterName.str());
 }
 
 StringBuffer& constructFileMask(const char* filename, StringBuffer& filemask)