sasha.xsl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  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:output method="xml" indent="yes" omit-xml-declaration="no" encoding="UTF-8"/>
  21. <xsl:template match="text()"/>
  22. <xsl:param name="process" select="'sasha'"/>
  23. <xsl:param name="isLinuxInstance" select="0"/>
  24. <xsl:variable name="oldPathChars">
  25. <xsl:choose>
  26. <xsl:when test="$isLinuxInstance = 1">'\\'</xsl:when>
  27. <xsl:otherwise>'/$'</xsl:otherwise>
  28. </xsl:choose>
  29. </xsl:variable>
  30. <xsl:variable name="newPathChars">
  31. <xsl:choose>
  32. <xsl:when test="$isLinuxInstance = 1">'/'</xsl:when>
  33. <xsl:otherwise>'\:'</xsl:otherwise>
  34. </xsl:choose>
  35. </xsl:variable>
  36. <xsl:template match="/">
  37. <xsl:apply-templates select="/Environment/Software/SashaServerProcess[@name=$process]"/>
  38. </xsl:template>
  39. <xsl:template match="SashaServerProcess">
  40. <SASHA>
  41. <xsl:attribute name="name">
  42. <xsl:value-of select="@name"/>
  43. </xsl:attribute>
  44. <xsl:attribute name="DALISERVERS"> <xsl:call-template name="getDaliServers">
  45. <xsl:with-param name="daliServer" select="@daliServers"/>
  46. </xsl:call-template>
  47. </xsl:attribute>
  48. <xsl:attribute name="logDir">
  49. <xsl:value-of select="translate(@logDir, $oldPathChars, $newPathChars)"/>
  50. </xsl:attribute>
  51. <xsl:attribute name="sashaUser">
  52. <xsl:value-of select="@sashaUser"/>
  53. </xsl:attribute>
  54. <xsl:attribute name="enableSNMP">
  55. <xsl:call-template name="outputBool">
  56. <xsl:with-param name="val" select="@enableSNMP"/>
  57. </xsl:call-template>
  58. </xsl:attribute>
  59. <xsl:attribute name="enableSysLog">
  60. <xsl:call-template name="outputBool">
  61. <xsl:with-param name="val" select="@enableSysLog"/>
  62. </xsl:call-template>
  63. </xsl:attribute>
  64. <xsl:attribute name="snmpSendWarnings">
  65. <xsl:call-template name="outputBool">
  66. <xsl:with-param name="val" select="@snmpSendWarnings"/>
  67. </xsl:call-template>
  68. </xsl:attribute>
  69. <xsl:attribute name="autoRestartInterval">
  70. <xsl:value-of select="@autoRestartInterval"/>
  71. </xsl:attribute>
  72. <xsl:copy-of select="/Environment/Software/Directories"/>
  73. <xsl:element name="LDS">
  74. <xsl:attribute name="rootdir">
  75. <xsl:value-of select="@LDSroot"/>
  76. </xsl:attribute>
  77. </xsl:element>
  78. <xsl:element name="Archiver">
  79. <xsl:element name="WorkUnits">
  80. <xsl:attribute name="limit">
  81. <xsl:value-of select="@WUlimit"/>
  82. </xsl:attribute>
  83. <xsl:attribute name="cutoff">
  84. <xsl:value-of select="@WUcutoff"/>
  85. </xsl:attribute>
  86. <xsl:attribute name="backup">
  87. <xsl:value-of select="@WUbackup"/>
  88. </xsl:attribute>
  89. <xsl:attribute name="interval">
  90. <xsl:value-of select="@WUinterval"/>
  91. </xsl:attribute>
  92. <xsl:attribute name="at">
  93. <xsl:value-of select="@WUat"/>
  94. </xsl:attribute>
  95. <xsl:attribute name="duration">
  96. <xsl:value-of select="@WUduration"/>
  97. </xsl:attribute>
  98. <xsl:attribute name="throttle">
  99. <xsl:value-of select="@WUthrottle"/>
  100. </xsl:attribute>
  101. <xsl:attribute name="retryinterval">
  102. <xsl:value-of select="@WUretryinterval"/>
  103. </xsl:attribute>
  104. <xsl:attribute name="keepResultFiles">
  105. <xsl:value-of select="@keepResultFiles"/>
  106. </xsl:attribute>
  107. </xsl:element>
  108. <xsl:element name="DFUrecovery">
  109. <xsl:attribute name="limit">
  110. <xsl:value-of select="@DFUrecoveryLimit"/>
  111. </xsl:attribute>
  112. <xsl:attribute name="cutoff">
  113. <xsl:value-of select="@DFUrecoveryCutoff"/>
  114. </xsl:attribute>
  115. <xsl:attribute name="interval">
  116. <xsl:value-of select="@DFUrecoveryInterval"/>
  117. </xsl:attribute>
  118. <xsl:attribute name="at">
  119. <xsl:value-of select="@DFUrecoveryAt"/>
  120. </xsl:attribute>
  121. </xsl:element>
  122. <xsl:element name="DFUworkunits">
  123. <xsl:attribute name="limit">
  124. <xsl:value-of select="@DFUWUlimit"/>
  125. </xsl:attribute>
  126. <xsl:attribute name="cutoff">
  127. <xsl:value-of select="@DFUWUcutoff"/>
  128. </xsl:attribute>
  129. <xsl:attribute name="interval">
  130. <xsl:value-of select="@DFUWUinterval"/>
  131. </xsl:attribute>
  132. <xsl:attribute name="at">
  133. <xsl:value-of select="@DFUWUat"/>
  134. </xsl:attribute>
  135. <xsl:attribute name="duration">
  136. <xsl:value-of select="@DFUWUduration"/>
  137. </xsl:attribute>
  138. <xsl:attribute name="throttle">
  139. <xsl:value-of select="@DFUWUthrottle"/>
  140. </xsl:attribute>
  141. </xsl:element>
  142. <xsl:element name="CachedWorkUnits">
  143. <xsl:attribute name="limit">
  144. <xsl:value-of select="@cachedWUlimit"/>
  145. </xsl:attribute>
  146. <xsl:attribute name="interval">
  147. <xsl:value-of select="@cachedWUinterval"/>
  148. </xsl:attribute>
  149. <xsl:attribute name="at">
  150. <xsl:value-of select="@cachedWUat"/>
  151. </xsl:attribute>
  152. </xsl:element>
  153. </xsl:element>
  154. <xsl:element name="Coalescer">
  155. <xsl:attribute name="interval">
  156. <xsl:value-of select="@coalesceInterval"/>
  157. </xsl:attribute>
  158. <xsl:attribute name="at">
  159. <xsl:value-of select="@coalesceAt"/>
  160. </xsl:attribute>
  161. <xsl:attribute name="minDeltaSize">
  162. <xsl:value-of select="@minDeltaSize"/>
  163. </xsl:attribute>
  164. <xsl:attribute name="recoverFromIncErrors">
  165. <xsl:value-of select="@recoverDeltaErrors"/>
  166. </xsl:attribute>
  167. </xsl:element>
  168. <xsl:element name="DfuXRef">
  169. <xsl:attribute name="interval">
  170. <xsl:value-of select="@xrefInterval"/>
  171. </xsl:attribute>
  172. <xsl:attribute name="at">
  173. <xsl:value-of select="@xrefAt"/>
  174. </xsl:attribute>
  175. <xsl:attribute name="clusterlist">
  176. <xsl:value-of select="@xrefList"/>
  177. </xsl:attribute>
  178. <xsl:attribute name="cutoff">
  179. <xsl:value-of select="@xrefCutoff"/>
  180. </xsl:attribute>
  181. <xsl:attribute name="maxScanThreads">
  182. <xsl:value-of select="@xrefMaxScanThreads"/>
  183. </xsl:attribute>
  184. <xsl:attribute name="eclwatchProvider">
  185. <xsl:call-template name="outputBool">
  186. <xsl:with-param name="val" select="@xrefEclWatchProvider"/>
  187. </xsl:call-template>
  188. </xsl:attribute>
  189. <xsl:attribute name="memoryLimit">
  190. <xsl:value-of select="@xrefMaxMemory"/>
  191. </xsl:attribute>
  192. <xsl:if test="string(@suspendCoalescerDuringXref) != ''">
  193. <xsl:attribute name="suspendCoalescerDuringXref">
  194. <xsl:value-of select="@suspendCoalescerDuringXref"/>
  195. </xsl:attribute>
  196. </xsl:if>
  197. </xsl:element>
  198. <xsl:element name="DfuExpiry">
  199. <xsl:attribute name="interval">
  200. <xsl:value-of select="@ExpiryInterval"/>
  201. </xsl:attribute>
  202. <xsl:attribute name="at">
  203. <xsl:value-of select="@ExpiryAt"/>
  204. </xsl:attribute>
  205. <xsl:if test="string(@PersistExpiryDefault) != ''">
  206. <xsl:attribute name="persistExpiryDefault">
  207. <xsl:value-of select="@PersistExpiryDefault"/>
  208. </xsl:attribute>
  209. </xsl:if>
  210. <xsl:if test="string(@ExpiryDefault) != ''">
  211. <xsl:attribute name="expiryDefault">
  212. <xsl:value-of select="@ExpiryDefault"/>
  213. </xsl:attribute>
  214. </xsl:if>
  215. </xsl:element>
  216. <xsl:element name="ThorQMon">
  217. <xsl:attribute name="queues">
  218. <xsl:value-of select="@thorQMonQueues"/>
  219. </xsl:attribute>
  220. <xsl:attribute name="interval">
  221. <xsl:value-of select="@thorQMonInterval"/>
  222. </xsl:attribute>
  223. <xsl:attribute name="switchMinTime">
  224. <xsl:value-of select="@thorQMonSwitchMinTime"/>
  225. </xsl:attribute>
  226. </xsl:element>
  227. <xsl:element name="DaFileSrvMonitor">
  228. <xsl:attribute name="interval">
  229. <xsl:value-of select="@dafsmonInterval"/>
  230. </xsl:attribute>
  231. <xsl:attribute name="at">
  232. <xsl:value-of select="@dafsmonAt"/>
  233. </xsl:attribute>
  234. <xsl:attribute name="clusterlist">
  235. <xsl:value-of select="@dafsmonList"/>
  236. </xsl:attribute>
  237. </xsl:element>
  238. </SASHA>
  239. </xsl:template>
  240. <xsl:template name="outputBool">
  241. <xsl:param name="val"/>
  242. <xsl:param name="default" select="0"/>
  243. <xsl:choose>
  244. <xsl:when test="$val='true'">1</xsl:when>
  245. <xsl:when test="$val='false'">0</xsl:when>
  246. <xsl:otherwise><xsl:value-of select='$default'/></xsl:otherwise>
  247. </xsl:choose>
  248. </xsl:template>
  249. <xsl:template name="getDaliServers">
  250. <xsl:param name="daliServer"/>
  251. <xsl:for-each select="/Environment/Software/DaliServerProcess[@name=$daliServer]/Instance">
  252. <xsl:call-template name="getNetAddress">
  253. <xsl:with-param name="computer" select="@computer"/>
  254. </xsl:call-template>
  255. <xsl:if test="string(@port) != ''">:<xsl:value-of select="@port"/>
  256. </xsl:if>
  257. <xsl:if test="position() != last()">, </xsl:if>
  258. </xsl:for-each>
  259. </xsl:template>
  260. <xsl:template name="getNetAddress">
  261. <xsl:param name="computer"/>
  262. <xsl:value-of select="/Environment/Hardware/Computer[@name=$computer]/@netAddress"/>
  263. </xsl:template>
  264. </xsl:stylesheet>