Browse Source

HPCC-9420 Pass Roxie directory settings to file copy function

This fix adds Roxie directory settings to file copy function because
those settings define the destinations of the file being copied.

Signed-off-by: Kevin Wang <kevin.wang@lexisnexis.com>
Kevin Wang 12 years ago
parent
commit
24ad96b107
2 changed files with 12 additions and 6 deletions
  1. 9 3
      esp/services/ws_fs/ws_fsService.cpp
  2. 3 3
      esp/services/ws_fs/ws_fsService.hpp

+ 9 - 3
esp/services/ws_fs/ws_fsService.cpp

@@ -2284,7 +2284,7 @@ bool CFileSprayEx::onDespray(IEspContext &context, IEspDespray &req, IEspDespray
 
 bool CFileSprayEx::doCopyForRoxie(IEspContext &context, const char * srcName, const char * srcDali, const char * srcUser, const char * srcPassword,
     const char * dstName, const char * destCluster, bool compressed, bool overwrite, bool supercopy, DFUclusterPartDiskMapping val,
-    StringBuffer baseDir, StringBuffer fileMask, IEspCopyResponse &resp)
+    StringBuffer baseDir, StringBuffer defaultFolder, StringBuffer defaultReplicateFolder, StringBuffer fileMask, IEspCopyResponse &resp)
 {
     StringBuffer user, passwd;
     Owned<IDFUWorkUnitFactory> factory = getDFUWorkUnitFactory();
@@ -2316,6 +2316,12 @@ bool CFileSprayEx::doCopyForRoxie(IEspContext &context, const char * srcName, co
     if(compressed)
         destination->setCompressed(true);
     destination->setWrap(true);                             // roxie always wraps
+    ClusterPartDiskMapSpec mspec;
+    destination->getClusterPartDiskMapSpec(destCluster, mspec);
+    mspec.setDefaultBaseDir(defaultFolder.str());
+    mspec.setDefaultReplicateDir(defaultReplicateFolder.str());
+    destination->setClusterPartDiskMapSpec(destCluster, mspec);
+
     IDFUoptions *options = wu->queryUpdateOptions();
     options->setOverwrite(overwrite);
     options->setReplicate(val==DFUcpdm_c_replicated_by_d);
@@ -2413,8 +2419,8 @@ bool CFileSprayEx::onCopy(IEspContext &context, IEspCopy &req, IEspCopyResponse
 
         if (bRoxie)
         {
-            return doCopyForRoxie(context, srcname, req.getSourceDali(), req.getSrcusername(), req.getSrcpassword(), 
-                dstname, destCluster, req.getCompress(), req.getOverwrite(), supercopy, val, baseDir, fileMask, resp);
+            return doCopyForRoxie(context, srcname, req.getSourceDali(), req.getSrcusername(), req.getSrcpassword(), dstname, destCluster,
+                req.getCompress(), req.getOverwrite(), supercopy, val, baseDir, defaultFolder, defaultReplicateFolder, fileMask, resp);
         }
 
         Owned<IDFUWorkUnitFactory> factory = getDFUWorkUnitFactory();

+ 3 - 3
esp/services/ws_fs/ws_fsService.hpp

@@ -91,9 +91,9 @@ protected:
 
     void addToQueryString(StringBuffer &queryString, const char *name, const char *value);
     int doFileCheck(const char* mask, const char* netaddr, const char* osStr, const char* path);
-    virtual bool doCopyForRoxie(IEspContext &context,   const char * srcName, const char * srcDali, const char * srcUser, 
-        const char * srcPassword, const char * dstName, const char * destCluster, bool compressed, bool overwrite, bool supercopy, 
-        DFUclusterPartDiskMapping val, StringBuffer baseDir, StringBuffer fileMask, IEspCopyResponse &resp);
+    virtual bool doCopyForRoxie(IEspContext &context, const char * srcName, const char * srcDali, const char * srcUser, const char * srcPassword,
+        const char * dstName, const char * destCluster, bool compressed, bool overwrite, bool supercopy, DFUclusterPartDiskMapping val,
+        StringBuffer baseDir, StringBuffer defaultFolder, StringBuffer defaultReplicateFolder, StringBuffer fileMask, IEspCopyResponse &resp);
     void getInfoFromSasha(IEspContext &context, const char *sashaServer, const char* wuid, IEspDFUWorkunit *info);
     bool getArchivedWUInfo(IEspContext &context, IEspGetDFUWorkunit &req, IEspGetDFUWorkunitResponse &resp);
     bool GetArchivedDFUWorkunits(IEspContext &context, IEspGetDFUWorkunits &req, IEspGetDFUWorkunitsResponse &resp);