Pārlūkot izejas kodu

HPCC-8184 Add calls to Roxie to bypass dafilesrv for network attached storage

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 gadi atpakaļ
vecāks
revīzija
633136af99

+ 11 - 1
common/environment/dalienv.cpp

@@ -466,11 +466,16 @@ IPropertyTree *envGetNASConfiguration()
 
 IPropertyTree *envGetInstallNASHooks()
 {
+    Owned<IPropertyTree> nasPTree = envGetNASConfiguration();
+    return envGetInstallNASHooks(nasPTree);
+}
+
+IPropertyTree *envGetInstallNASHooks(IPropertyTree *nasPTree)
+{
     IDaFileSrvHook *daFileSrvHook = queryDaFileSrvHook();
     if (!daFileSrvHook) // probably always installed
         return NULL;
     daFileSrvHook->clearSubNetFilters();
-    Owned<IPropertyTree> nasPTree = envGetNASConfiguration();
     if (!nasPTree)
         return NULL;
     return daFileSrvHook->addMySubnetFilters(nasPTree);
@@ -480,3 +485,8 @@ void envInstallNASHooks()
 {
     Owned<IPropertyTree> installedFilters = envGetInstallNASHooks();
 }
+
+void envInstallNASHooks(IPropertyTree *nasPTree)
+{
+    Owned<IPropertyTree> installedFilters = envGetInstallNASHooks(nasPTree);
+}

+ 5 - 3
common/environment/dalienv.hpp

@@ -51,9 +51,11 @@ extern ENVIRONMENT_API bool getRemoteRunInfo(const char * keyName, const char *
 
 extern ENVIRONMENT_API bool envGetConfigurationDirectory(const char *category, const char *component,const char *instance, StringBuffer &dirout);
 
-extern ENVIRONMENT_API IPropertyTree *envGetNASConfiguration(); // return NAS config
-extern ENVIRONMENT_API void envInstallNASHooks(); // gets NAS config and sets up
-// like envInstallNASHooksalso but also reutrns which filters were installed
+extern ENVIRONMENT_API IPropertyTree *envGetNASConfiguration(); // return NAS config from environment
+extern ENVIRONMENT_API void envInstallNASHooks(); // gets NAS config and sets up NAS hooks from it
+extern ENVIRONMENT_API void envInstallNASHooks(IPropertyTree *nasPTree); // Sets NAS hooks from user-supplied info
+// like envInstallNASHooks but also returns which filters were installed
 extern ENVIRONMENT_API IPropertyTree *envGetInstallNASHooks();
+extern ENVIRONMENT_API IPropertyTree *envGetInstallNASHooks(IPropertyTree *nasPTree);
 
 #endif

+ 1 - 0
initfiles/componentfiles/configxml/RoxieTopology.xsl

@@ -117,6 +117,7 @@
                 <xsl:value-of select="translate($path3, $oldPathSeparator, $newPathSeparator)"/>
             </xsl:attribute>
             <xsl:copy-of select="/Environment/Software/Directories"/>
+            <xsl:copy-of select="/Environment/Hardware/NAS"/>
             <xsl:for-each select="ACL">
                 <xsl:copy>
                     <xsl:copy-of select="@name"/>

+ 4 - 0
roxie/ccd/ccdmain.cpp

@@ -28,6 +28,7 @@
 #include "jutil.hpp"
 #include <build-config.h>
 
+#include "dalienv.hpp"
 #include "rmtfile.hpp"
 #include "ccd.hpp"
 #include "ccdquery.hpp"
@@ -639,6 +640,9 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
             lazyOpen = (restarts > 0);
         else
             lazyOpen = topology->getPropBool("@lazyOpen", false);
+        bool useNasTranslation = topology->getPropBool("@useNASTranslation", true);
+        if (useNasTranslation)
+            envInstallNASHooks(topology->queryPropTree("Environment/Hardware/NAS"));
         localSlave = topology->getPropBool("@localSlave", false);
         doIbytiDelay = topology->getPropBool("@doIbytiDelay", true);
         minIbytiDelay = topology->getPropInt("@minIbytiDelay", 2);