config_mapping.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. 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. var configs = [
  19. /**********************************************HDFS***************************************/
  20. {
  21. "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
  22. "templateName": ["proxyuser_group"],
  23. "foreignKey": ["hive_user"],
  24. "value": "<templateName[0]>",
  25. "filename": "core-site.xml",
  26. "isOverridable" : true
  27. },
  28. {
  29. "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
  30. "templateName": ["hivemetastore_host"],
  31. "foreignKey": ["hive_user"],
  32. "value": "<templateName[0]>",
  33. "filename": "core-site.xml",
  34. "isOverridable" : true
  35. },
  36. {
  37. "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
  38. "templateName": ["proxyuser_group"],
  39. "foreignKey": ["oozie_user"],
  40. "value": "<templateName[0]>",
  41. "filename": "core-site.xml",
  42. "isOverridable" : true
  43. },
  44. {
  45. "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
  46. "templateName": ["oozieserver_host"],
  47. "foreignKey": ["oozie_user"],
  48. "value": "<templateName[0]>",
  49. "filename": "core-site.xml",
  50. "isOverridable" : true
  51. },
  52. {
  53. "name": "hadoop.proxyuser.<foreignKey[0]>.groups",
  54. "templateName": ["proxyuser_group"],
  55. "foreignKey": ["webhcat_user"],
  56. "value": "<templateName[0]>",
  57. "filename": "core-site.xml",
  58. "isOverridable" : true
  59. },
  60. {
  61. "name": "hadoop.proxyuser.<foreignKey[0]>.hosts",
  62. "templateName": ["hivemetastore_host"],
  63. "foreignKey": ["webhcat_user"],
  64. "value": "<templateName[0]>",
  65. "filename": "core-site.xml",
  66. "isOverridable" : true
  67. },
  68. /**********************************************hbase-site***************************************/
  69. {
  70. "name": "hbase.rootdir",
  71. "templateName": ["namenode_host", "hbase_hdfs_root_dir"],
  72. "foreignKey": null,
  73. "value": "hdfs://<templateName[0]>:8020<templateName[1]>",
  74. "filename": "hbase-site.xml"
  75. },
  76. {
  77. "name": "hbase.zookeeper.quorum",
  78. "templateName": ["zookeeperserver_hosts"],
  79. "foreignKey": null,
  80. "value": "<templateName[0]>",
  81. "filename": "hbase-site.xml"
  82. },
  83. /**********************************************webhcat-site***************************************/
  84. {
  85. "name": "templeton.zookeeper.hosts",
  86. "templateName": ["zookeeperserver_hosts"],
  87. "foreignKey": null,
  88. "value": "<templateName[0]>",
  89. "filename": "webhcat-site.xml"
  90. },
  91. /**********************************************core-site for glusterfs***************************************/
  92. {
  93. "name": "fs.glusterfs.impl",
  94. "templateName": ["fs_glusterfs_impl"],
  95. "foreignKey": null,
  96. "value": "<templateName[0]>",
  97. "filename": "core-site.xml"
  98. },
  99. {
  100. "name": "fs.glusterfs.volname",
  101. "templateName": ["fs_glusterfs_volname"],
  102. "foreignKey": null,
  103. "value": "<templateName[0]>",
  104. "filename": "core-site.xml"
  105. },
  106. {
  107. "name": "fs.glusterfs.mount",
  108. "templateName": ["fs_glusterfs_mount"],
  109. "foreignKey": null,
  110. "value": "<templateName[0]>",
  111. "filename": "core-site.xml"
  112. },
  113. {
  114. "name": "fs.glusterfs.server",
  115. "templateName": ["fs_glusterfs_server"],
  116. "foreignKey": null,
  117. "value": "<templateName[0]>",
  118. "filename": "core-site.xml"
  119. },
  120. {
  121. "name": "fs.glusterfs.automount",
  122. "templateName": ["fs_glusterfs_automount"],
  123. "foreignKey": null,
  124. "value": "<templateName[0]>",
  125. "filename": "core-site.xml"
  126. },
  127. {
  128. "name": "fs.glusterfs.getfattrcmd",
  129. "templateName": ["fs_glusterfs_getfattrcmd"],
  130. "foreignKey": null,
  131. "value": "<templateName[0]>",
  132. "filename": "core-site.xml"
  133. }
  134. ];
  135. /**
  136. * Configs consists of 2 types: Computed values, which cannot be modified by user
  137. * and overridable values, which user can modify. We provide interface how to get all of this
  138. * configs separately
  139. * @type {Object}
  140. */
  141. module.exports = {
  142. all : function(){
  143. return configs.slice(0);
  144. },
  145. overridable: function(){
  146. return configs.filterProperty('foreignKey');
  147. },
  148. computed: function(){
  149. return configs.filterProperty('foreignKey', null);
  150. }
  151. };