roxievars_linux.xsl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ################################################################################
  4. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. ################################################################################
  18. -->
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:space="default">
  20. <xsl:param name="process" select="'unknown'"/>
  21. <xsl:strip-space elements="*"/>
  22. <xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
  23. <xsl:template match="text()"/>
  24. <xsl:template match="/">
  25. <xsl:apply-templates select="Environment/Software/RoxieCluster[@name=$process]"/>
  26. </xsl:template>
  27. <xsl:template match="RoxieCluster">
  28. <xsl:if test="@name=$process"># roxievars file generated by roxievars_linux.xsl
  29. export roxiedir=<xsl:call-template name="makeAbsolutePath"><xsl:with-param name="path" select="@directory"/></xsl:call-template>
  30. export querydir=<xsl:call-template name="makeAbsolutePath"><xsl:with-param name="path" select="@queryDir"/></xsl:call-template>
  31. export logdir=<xsl:choose>
  32. <xsl:when test="@logDir">
  33. <xsl:call-template name="makeAbsolutePath"><xsl:with-param name="path" select="@logDir"/></xsl:call-template>
  34. </xsl:when>
  35. <xsl:otherwise>/c$/roxie_logs</xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:if>
  38. <xsl:variable name="MaxFilesOpen" select="2*(@maxLocalFilesOpen+@maxRemoteFilesOpen)"/>
  39. <xsl:variable name="NumHandles">
  40. <xsl:choose>
  41. <xsl:when test="$MaxFilesOpen > 8192">
  42. <xsl:value-of select="$MaxFilesOpen"/>
  43. </xsl:when>
  44. <xsl:otherwise>8192</xsl:otherwise>
  45. </xsl:choose>
  46. </xsl:variable>
  47. export NUM_ROXIE_HANDLES=<xsl:value-of select="$NumHandles"/>
  48. <xsl:if test="string(@SSHidentityfile) != ''">
  49. export SSHidentityfile=<xsl:value-of select="@SSHidentityfile"/>
  50. </xsl:if>
  51. <xsl:if test="string(@SSHusername) != ''">
  52. export SSHusername=<xsl:value-of select="@SSHusername"/>
  53. </xsl:if>
  54. <xsl:if test="string(@SSHpassword) != ''">
  55. export SSHpassword=<xsl:value-of select="@SSHpassword"/>
  56. </xsl:if>
  57. <xsl:if test="string(@SSHtimeout) != ''">
  58. export SSHtimeout=<xsl:value-of select="@SSHtimeout"/>
  59. </xsl:if>
  60. <xsl:if test="string(@SSHretries) != ''">
  61. export SSHretries=<xsl:value-of select="@SSHretries"/>
  62. </xsl:if>
  63. <xsl:if test="string(@SSHsudomount) != ''">
  64. export SSHsudomount=<xsl:value-of select="@SSHsudomount"/>
  65. </xsl:if>
  66. </xsl:template>
  67. <xsl:template name="makeAbsolutePath">
  68. <xsl:param name="path"/>
  69. <xsl:variable name="newPath" select="translate($path, '\:', '/$')"/>
  70. <xsl:if test="not(starts-with($newPath, '/'))">/</xsl:if>
  71. <xsl:value-of select="$newPath"/>
  72. </xsl:template>
  73. </xsl:stylesheet>