Ver código fonte

Merge branch 'HPCC-17293-feature-6.4.0' into candidate-6.4.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 anos atrás
pai
commit
035c1efabe

+ 17 - 0
common/environment/environment.cpp

@@ -127,6 +127,8 @@ private:
         xpath.append(computer).append("\"]/number");
         xpath.append(computer).append("\"]/number");
         return xpath;
         return xpath;
     }
     }
+    mutable bool isDropZoneRestrictionLoaded = false;
+    mutable bool dropZoneRestrictionEnabled = true;
 
 
 public:
 public:
     IMPLEMENT_IINTERFACE;
     IMPLEMENT_IINTERFACE;
@@ -181,6 +183,7 @@ public:
 
 
     unsigned getNumberOfDropZones() const { buildDropZoneCache(); return numOfDropZones; }
     unsigned getNumberOfDropZones() const { buildDropZoneCache(); return numOfDropZones; }
     IConstDropZoneInfo * getDropZoneByIndex(unsigned index) const;
     IConstDropZoneInfo * getDropZoneByIndex(unsigned index) const;
+    bool isDropZoneRestrictionEnabled() const;
 };
 };
 
 
 class CLockedEnvironment : implements IEnvironment, public CInterface
 class CLockedEnvironment : implements IEnvironment, public CInterface
@@ -295,6 +298,8 @@ public:
             { return c->getDropZoneByAddressPath(netaddress, targetPath); }
             { return c->getDropZoneByAddressPath(netaddress, targetPath); }
     virtual IConstDropZoneInfoIterator * getDropZoneIterator() const
     virtual IConstDropZoneInfoIterator * getDropZoneIterator() const
             { return c->getDropZoneIterator(); }
             { return c->getDropZoneIterator(); }
+    virtual bool isDropZoneRestrictionEnabled() const
+            { return c->isDropZoneRestrictionEnabled(); }
 };
 };
 
 
 void CLockedEnvironment::commit()
 void CLockedEnvironment::commit()
@@ -1034,6 +1039,7 @@ void CLocalEnvironment::init()
     numOfMachines = 0;
     numOfMachines = 0;
     numOfDropZones = 0;
     numOfDropZones = 0;
     numOfDropzonesByComputer.setown(createPTree("computers"));
     numOfDropzonesByComputer.setown(createPTree("computers"));
+    isDropZoneRestrictionLoaded = false;
 }
 }
 
 
 CLocalEnvironment::~CLocalEnvironment()
 CLocalEnvironment::~CLocalEnvironment()
@@ -1642,6 +1648,17 @@ IConstMachineInfoIterator * CLocalEnvironment::getMachineIterator() const
     return new CConstMachineInfoIterator();
     return new CConstMachineInfoIterator();
 }
 }
 
 
+bool CLocalEnvironment::isDropZoneRestrictionEnabled() const
+{
+    if (!isDropZoneRestrictionLoaded)
+    {
+        dropZoneRestrictionEnabled = queryEnvironmentConf().getPropBool("useDropZoneRestriction", true);
+        isDropZoneRestrictionLoaded=true;
+    }
+
+    return dropZoneRestrictionEnabled;
+}
+
 //==========================================================================================
 //==========================================================================================
 // Iterators implementation
 // Iterators implementation
 
 

+ 1 - 0
common/environment/environment.hpp

@@ -139,6 +139,7 @@ interface IConstEnvironment : extends IConstEnvBase
     // returns a drop zone that is defined on IP with the shortest path that's a parent of targetPath
     // returns a drop zone that is defined on IP with the shortest path that's a parent of targetPath
     virtual IConstDropZoneInfo * getDropZoneByAddressPath(const char * netaddress, const char *targetPath) const = 0;
     virtual IConstDropZoneInfo * getDropZoneByAddressPath(const char * netaddress, const char *targetPath) const = 0;
     virtual IConstDropZoneInfoIterator * getDropZoneIterator() const = 0;
     virtual IConstDropZoneInfoIterator * getDropZoneIterator() const = 0;
+    virtual bool isDropZoneRestrictionEnabled() const = 0;
 };
 };
 
 
 
 

+ 4 - 2
dali/ft/filecopy.cpp

@@ -2704,8 +2704,10 @@ void FileSprayer::checkFilePath(RemoteFilename & filename)
             Owned<IConstDropZoneInfo> dropZone = env->getDropZoneByAddressPath(netaddress.str(), pfilePath);
             Owned<IConstDropZoneInfo> dropZone = env->getDropZoneByAddressPath(netaddress.str(), pfilePath);
             if (!dropZone)
             if (!dropZone)
             {
             {
-                LOG(MCdebugInfo, unknownJob, "No matching drop zone path to file path: '%s'", pfilePath);
-                // throwError1(DFTERR_NoMatchingDropzonePath, pfilePath);
+                if (env->isDropZoneRestrictionEnabled())
+                    throwError1(DFTERR_NoMatchingDropzonePath, pfilePath);
+                else
+                    LOG(MCdebugInfo, unknownJob, "No matching drop zone path to file path: '%s'", pfilePath);
             }
             }
             else
             else
             {
             {

+ 5 - 1
initfiles/etc/DIR_NAME/environment.conf.in

@@ -44,4 +44,8 @@ jvmoptions=-XX:-UsePerfData
 #
 #
 # Multiple paths can be specified (separate with :, or ; on Windows).
 # Multiple paths can be specified (separate with :, or ; on Windows).
 # Relative paths are assumed to be relative to ${INSTALL_DIR}/versioned
 # Relative paths are assumed to be relative to ${INSTALL_DIR}/versioned
-additionalPlugins=python2
+additionalPlugins=python2
+
+# To en-/disable Drop Zone restriction.
+# Default is enabled (true).
+useDropZoneRestriction=true

+ 3 - 3
testing/regress/ecl/key/despray.xml

@@ -13,13 +13,13 @@
  <Row><result>Fail</result></Row>
  <Row><result>Fail</result></Row>
 </Dataset>
 </Dataset>
 <Dataset name='Result 6'>
 <Dataset name='Result 6'>
- <Row><result>Pass</result></Row>
+ <Row><result>Fail</result></Row>
 </Dataset>
 </Dataset>
 <Dataset name='Result 7'>
 <Dataset name='Result 7'>
- <Row><result>Pass</result></Row>
+ <Row><result>Fail</result></Row>
 </Dataset>
 </Dataset>
 <Dataset name='Result 8'>
 <Dataset name='Result 8'>
- <Row><result>Pass</result></Row>
+ <Row><result>Fail</result></Row>
 </Dataset>
 </Dataset>
 <Dataset name='Result 9'>
 <Dataset name='Result 9'>
  <Row><result>Pass</result></Row>
  <Row><result>Pass</result></Row>