Просмотр исходного кода

Merge pull request #3715 from jakesmith/remotecluster-paths

HPCC-1766 Use correct paths for non-local cluster writes

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 лет назад
Родитель
Сommit
9ed98b4832
1 измененных файлов с 20 добавлено и 2 удалено
  1. 20 2
      thorlcr/mfilemanager/thmfilemanager.cpp

+ 20 - 2
thorlcr/mfilemanager/thmfilemanager.cpp

@@ -438,8 +438,26 @@ public:
             if (temporary && !job.queryUseCheckpoints()) 
                 dir.append(queryTempDir(false));
             else
-                makePhysicalPartName(scopedName.str(), 0, 0, dir, false, os);
-
+            {
+                // NB: always >= 1 groupNames
+                StringBuffer curDir;
+                ForEachItemIn(gn, groupNames)
+                {
+                    if (!getConfigurationDirectory(globals->queryPropTree("Directories"), "data", "thor", groupNames.item(gn), curDir))
+                        makePhysicalPartName(scopedName.str(), 0, 0, curDir, false, os); // legacy
+                    if (!dir.length())
+                        dir.swapWith(curDir);
+                    else
+                    {
+                        if (!streq(curDir, dir))
+                            throw MakeStringException(0, "When targeting multiple clusters on a write, the clusters must have the same target directory");
+                        curDir.clear();
+                    }
+                }
+                curDir.swapWith(dir);
+                // places logical filename directory in 'dir'
+                makePhysicalPartName(scopedName.str(), 0, 0, dir, false, os, curDir.str());
+            }
             desc->setDefaultDir(dir.str());
 
             StringBuffer partmask;