PageRenderTime 92ms CodeModel.GetById 70ms RepoModel.GetById 4ms app.codeStats 0ms

/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeys.java

https://gitlab.com/xiaoliuliu2050/hadoop
Java | 292 lines | 165 code | 41 blank | 86 comment | 0 complexity | c48f8e08a781f9402636a490330c9510 MD5 | raw file
  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. package org.apache.hadoop.fs;
  19. import org.apache.hadoop.classification.InterfaceAudience;
  20. import org.apache.hadoop.classification.InterfaceStability;
  21. import org.apache.hadoop.http.lib.StaticUserWebFilter;
  22. /**
  23. * This class contains constants for configuration keys used
  24. * in the common code.
  25. *
  26. * It inherits all the publicly documented configuration keys
  27. * and adds unsupported keys.
  28. *
  29. */
  30. @InterfaceAudience.Private
  31. @InterfaceStability.Unstable
  32. public class CommonConfigurationKeys extends CommonConfigurationKeysPublic {
  33. /** Default location for user home directories */
  34. public static final String FS_HOME_DIR_KEY = "fs.homeDir";
  35. /** Default value for FS_HOME_DIR_KEY */
  36. public static final String FS_HOME_DIR_DEFAULT = "/user";
  37. /** Default umask for files created in HDFS */
  38. public static final String FS_PERMISSIONS_UMASK_KEY =
  39. "fs.permissions.umask-mode";
  40. /** Default value for FS_PERMISSIONS_UMASK_KEY */
  41. public static final int FS_PERMISSIONS_UMASK_DEFAULT = 0022;
  42. /** How often does RPC client send pings to RPC server */
  43. public static final String IPC_PING_INTERVAL_KEY = "ipc.ping.interval";
  44. /** Default value for IPC_PING_INTERVAL_KEY */
  45. public static final int IPC_PING_INTERVAL_DEFAULT = 60000; // 1 min
  46. /** Enables pings from RPC client to the server */
  47. public static final String IPC_CLIENT_PING_KEY = "ipc.client.ping";
  48. /** Default value of IPC_CLIENT_PING_KEY */
  49. public static final boolean IPC_CLIENT_PING_DEFAULT = true;
  50. /** Responses larger than this will be logged */
  51. public static final String IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY =
  52. "ipc.server.max.response.size";
  53. /** Default value for IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY */
  54. public static final int IPC_SERVER_RPC_MAX_RESPONSE_SIZE_DEFAULT =
  55. 1024*1024;
  56. /** Number of threads in RPC server reading from the socket */
  57. public static final String IPC_SERVER_RPC_READ_THREADS_KEY =
  58. "ipc.server.read.threadpool.size";
  59. /** Default value for IPC_SERVER_RPC_READ_THREADS_KEY */
  60. public static final int IPC_SERVER_RPC_READ_THREADS_DEFAULT = 1;
  61. /** Number of pending connections that may be queued per socket reader */
  62. public static final String IPC_SERVER_RPC_READ_CONNECTION_QUEUE_SIZE_KEY =
  63. "ipc.server.read.connection-queue.size";
  64. /** Default value for IPC_SERVER_RPC_READ_CONNECTION_QUEUE_SIZE */
  65. public static final int IPC_SERVER_RPC_READ_CONNECTION_QUEUE_SIZE_DEFAULT =
  66. 100;
  67. public static final String IPC_MAXIMUM_DATA_LENGTH =
  68. "ipc.maximum.data.length";
  69. public static final int IPC_MAXIMUM_DATA_LENGTH_DEFAULT = 64 * 1024 * 1024;
  70. /** How many calls per handler are allowed in the queue. */
  71. public static final String IPC_SERVER_HANDLER_QUEUE_SIZE_KEY =
  72. "ipc.server.handler.queue.size";
  73. /** Default value for IPC_SERVER_HANDLER_QUEUE_SIZE_KEY */
  74. public static final int IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT = 100;
  75. /**
  76. * CallQueue related settings. These are not used directly, but rather
  77. * combined with a namespace and port. For instance:
  78. * IPC_CALLQUEUE_NAMESPACE + ".8020." + IPC_CALLQUEUE_IMPL_KEY
  79. */
  80. public static final String IPC_CALLQUEUE_NAMESPACE = "ipc";
  81. public static final String IPC_CALLQUEUE_IMPL_KEY = "callqueue.impl";
  82. public static final String IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY = "identity-provider.impl";
  83. /** Internal buffer size for Lzo compressor/decompressors */
  84. public static final String IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_KEY =
  85. "io.compression.codec.lzo.buffersize";
  86. /** Default value for IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_KEY */
  87. public static final int IO_COMPRESSION_CODEC_LZO_BUFFERSIZE_DEFAULT =
  88. 64*1024;
  89. /** This is for specifying the implementation for the mappings from
  90. * hostnames to the racks they belong to
  91. */
  92. public static final String NET_TOPOLOGY_CONFIGURED_NODE_MAPPING_KEY =
  93. "net.topology.configured.node.mapping";
  94. /** Internal buffer size for Snappy compressor/decompressors */
  95. public static final String IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY =
  96. "io.compression.codec.snappy.buffersize";
  97. /** Default value for IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY */
  98. public static final int IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_DEFAULT =
  99. 256 * 1024;
  100. /** Internal buffer size for Lz4 compressor/decompressors */
  101. public static final String IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_KEY =
  102. "io.compression.codec.lz4.buffersize";
  103. /** Default value for IO_COMPRESSION_CODEC_SNAPPY_BUFFERSIZE_KEY */
  104. public static final int IO_COMPRESSION_CODEC_LZ4_BUFFERSIZE_DEFAULT =
  105. 256 * 1024;
  106. /** Use lz4hc(slow but with high compression ratio) for lz4 compression */
  107. public static final String IO_COMPRESSION_CODEC_LZ4_USELZ4HC_KEY =
  108. "io.compression.codec.lz4.use.lz4hc";
  109. /** Default value for IO_COMPRESSION_CODEC_USELZ4HC_KEY */
  110. public static final boolean IO_COMPRESSION_CODEC_LZ4_USELZ4HC_DEFAULT =
  111. false;
  112. /**
  113. * Service Authorization
  114. */
  115. public static final String
  116. HADOOP_SECURITY_SERVICE_AUTHORIZATION_DEFAULT_ACL =
  117. "security.service.authorization.default.acl";
  118. public static final String
  119. HADOOP_SECURITY_SERVICE_AUTHORIZATION_DEFAULT_BLOCKED_ACL =
  120. "security.service.authorization.default.acl.blocked";
  121. public static final String
  122. HADOOP_SECURITY_SERVICE_AUTHORIZATION_REFRESH_POLICY =
  123. "security.refresh.policy.protocol.acl";
  124. public static final String
  125. HADOOP_SECURITY_SERVICE_AUTHORIZATION_GET_USER_MAPPINGS =
  126. "security.get.user.mappings.protocol.acl";
  127. public static final String
  128. HADOOP_SECURITY_SERVICE_AUTHORIZATION_REFRESH_USER_MAPPINGS =
  129. "security.refresh.user.mappings.protocol.acl";
  130. public static final String
  131. HADOOP_SECURITY_SERVICE_AUTHORIZATION_REFRESH_CALLQUEUE =
  132. "security.refresh.callqueue.protocol.acl";
  133. public static final String
  134. HADOOP_SECURITY_SERVICE_AUTHORIZATION_GENERIC_REFRESH =
  135. "security.refresh.generic.protocol.acl";
  136. public static final String
  137. HADOOP_SECURITY_SERVICE_AUTHORIZATION_TRACING =
  138. "security.trace.protocol.acl";
  139. public static final String
  140. SECURITY_HA_SERVICE_PROTOCOL_ACL = "security.ha.service.protocol.acl";
  141. public static final String
  142. SECURITY_ZKFC_PROTOCOL_ACL = "security.zkfc.protocol.acl";
  143. public static final String
  144. SECURITY_CLIENT_PROTOCOL_ACL = "security.client.protocol.acl";
  145. public static final String SECURITY_CLIENT_DATANODE_PROTOCOL_ACL =
  146. "security.client.datanode.protocol.acl";
  147. public static final String
  148. SECURITY_DATANODE_PROTOCOL_ACL = "security.datanode.protocol.acl";
  149. public static final String
  150. SECURITY_INTER_DATANODE_PROTOCOL_ACL = "security.inter.datanode.protocol.acl";
  151. public static final String
  152. SECURITY_NAMENODE_PROTOCOL_ACL = "security.namenode.protocol.acl";
  153. public static final String SECURITY_QJOURNAL_SERVICE_PROTOCOL_ACL =
  154. "security.qjournal.service.protocol.acl";
  155. public static final String HADOOP_SECURITY_TOKEN_SERVICE_USE_IP =
  156. "hadoop.security.token.service.use_ip";
  157. public static final boolean HADOOP_SECURITY_TOKEN_SERVICE_USE_IP_DEFAULT =
  158. true;
  159. /**
  160. * HA health monitor and failover controller.
  161. */
  162. /** How often to retry connecting to the service. */
  163. public static final String HA_HM_CONNECT_RETRY_INTERVAL_KEY =
  164. "ha.health-monitor.connect-retry-interval.ms";
  165. public static final long HA_HM_CONNECT_RETRY_INTERVAL_DEFAULT = 1000;
  166. /* How often to check the service. */
  167. public static final String HA_HM_CHECK_INTERVAL_KEY =
  168. "ha.health-monitor.check-interval.ms";
  169. public static final long HA_HM_CHECK_INTERVAL_DEFAULT = 1000;
  170. /* How long to sleep after an unexpected RPC error. */
  171. public static final String HA_HM_SLEEP_AFTER_DISCONNECT_KEY =
  172. "ha.health-monitor.sleep-after-disconnect.ms";
  173. public static final long HA_HM_SLEEP_AFTER_DISCONNECT_DEFAULT = 1000;
  174. /* Timeout for the actual monitorHealth() calls. */
  175. public static final String HA_HM_RPC_TIMEOUT_KEY =
  176. "ha.health-monitor.rpc-timeout.ms";
  177. public static final int HA_HM_RPC_TIMEOUT_DEFAULT = 45000;
  178. /* Timeout that the FC waits for the new active to become active */
  179. public static final String HA_FC_NEW_ACTIVE_TIMEOUT_KEY =
  180. "ha.failover-controller.new-active.rpc-timeout.ms";
  181. public static final int HA_FC_NEW_ACTIVE_TIMEOUT_DEFAULT = 60000;
  182. /* Timeout that the FC waits for the old active to go to standby */
  183. public static final String HA_FC_GRACEFUL_FENCE_TIMEOUT_KEY =
  184. "ha.failover-controller.graceful-fence.rpc-timeout.ms";
  185. public static final int HA_FC_GRACEFUL_FENCE_TIMEOUT_DEFAULT = 5000;
  186. /* FC connection retries for graceful fencing */
  187. public static final String HA_FC_GRACEFUL_FENCE_CONNECTION_RETRIES =
  188. "ha.failover-controller.graceful-fence.connection.retries";
  189. public static final int HA_FC_GRACEFUL_FENCE_CONNECTION_RETRIES_DEFAULT = 1;
  190. /** number of zookeeper operation retry times in ActiveStandbyElector */
  191. public static final String HA_FC_ELECTOR_ZK_OP_RETRIES_KEY =
  192. "ha.failover-controller.active-standby-elector.zk.op.retries";
  193. public static final int HA_FC_ELECTOR_ZK_OP_RETRIES_DEFAULT = 3;
  194. /* Timeout that the CLI (manual) FC waits for monitorHealth, getServiceState */
  195. public static final String HA_FC_CLI_CHECK_TIMEOUT_KEY =
  196. "ha.failover-controller.cli-check.rpc-timeout.ms";
  197. public static final int HA_FC_CLI_CHECK_TIMEOUT_DEFAULT = 20000;
  198. /** Static user web-filter properties.
  199. * See {@link StaticUserWebFilter}.
  200. */
  201. public static final String HADOOP_HTTP_STATIC_USER =
  202. "hadoop.http.staticuser.user";
  203. public static final String DEFAULT_HADOOP_HTTP_STATIC_USER =
  204. "dr.who";
  205. /**
  206. * User->groups static mapping to override the groups lookup
  207. */
  208. public static final String HADOOP_USER_GROUP_STATIC_OVERRIDES =
  209. "hadoop.user.group.static.mapping.overrides";
  210. public static final String HADOOP_USER_GROUP_STATIC_OVERRIDES_DEFAULT =
  211. "dr.who=;";
  212. /** Enable/Disable aliases serving from jetty */
  213. public static final String HADOOP_JETTY_LOGS_SERVE_ALIASES =
  214. "hadoop.jetty.logs.serve.aliases";
  215. public static final boolean DEFAULT_HADOOP_JETTY_LOGS_SERVE_ALIASES =
  216. true;
  217. /* Path to the Kerberos ticket cache. Setting this will force
  218. * UserGroupInformation to use only this ticket cache file when creating a
  219. * FileSystem instance.
  220. */
  221. public static final String KERBEROS_TICKET_CACHE_PATH =
  222. "hadoop.security.kerberos.ticket.cache.path";
  223. public static final String HADOOP_SECURITY_UID_NAME_CACHE_TIMEOUT_KEY =
  224. "hadoop.security.uid.cache.secs";
  225. public static final long HADOOP_SECURITY_UID_NAME_CACHE_TIMEOUT_DEFAULT =
  226. 4*60*60; // 4 hours
  227. public static final String IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY = "ipc.client.fallback-to-simple-auth-allowed";
  228. public static final boolean IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_DEFAULT = false;
  229. public static final String IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SASL_KEY =
  230. "ipc.client.connect.max.retries.on.sasl";
  231. public static final int IPC_CLIENT_CONNECT_MAX_RETRIES_ON_SASL_DEFAULT = 5;
  232. /** How often the server scans for idle connections */
  233. public static final String IPC_CLIENT_CONNECTION_IDLESCANINTERVAL_KEY =
  234. "ipc.client.connection.idle-scan-interval.ms";
  235. /** Default value for IPC_SERVER_CONNECTION_IDLE_SCAN_INTERVAL_KEY */
  236. public static final int IPC_CLIENT_CONNECTION_IDLESCANINTERVAL_DEFAULT =
  237. 10000;
  238. public static final String HADOOP_USER_GROUP_METRICS_PERCENTILES_INTERVALS =
  239. "hadoop.user.group.metrics.percentiles.intervals";
  240. public static final String RPC_METRICS_QUANTILE_ENABLE =
  241. "rpc.metrics.quantile.enable";
  242. public static final boolean RPC_METRICS_QUANTILE_ENABLE_DEFAULT = false;
  243. public static final String RPC_METRICS_PERCENTILES_INTERVALS_KEY =
  244. "rpc.metrics.percentiles.intervals";
  245. /** Allowed hosts for nfs exports */
  246. public static final String NFS_EXPORTS_ALLOWED_HOSTS_SEPARATOR = ";";
  247. public static final String NFS_EXPORTS_ALLOWED_HOSTS_KEY = "nfs.exports.allowed.hosts";
  248. public static final String NFS_EXPORTS_ALLOWED_HOSTS_KEY_DEFAULT = "* rw";
  249. public static final String HADOOP_TRACE_SAMPLER = "hadoop.htrace.sampler";
  250. public static final String HADOOP_TRACE_SAMPLER_DEFAULT = "NeverSampler";
  251. }