yarn-config.sh 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements. See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License. You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. function hadoop_subproject_init
  16. {
  17. # at some point in time, someone thought it would be a good idea to
  18. # create separate vars for every subproject. *sigh*
  19. # let's perform some overrides and setup some defaults for bw compat
  20. # this way the common hadoop var's == subproject vars and can be
  21. # used interchangeable from here on out
  22. # ...
  23. # this should get deprecated at some point.
  24. if [[ -z "${HADOOP_YARN_ENV_PROCESSED}" ]]; then
  25. if [[ -e "${YARN_CONF_DIR}/yarn-env.sh" ]]; then
  26. . "${YARN_CONF_DIR}/yarn-env.sh"
  27. elif [[ -e "${HADOOP_CONF_DIR}/yarn-env.sh" ]]; then
  28. . "${HADOOP_CONF_DIR}/yarn-env.sh"
  29. fi
  30. export HADOOP_YARN_ENV_PROCESSED=true
  31. fi
  32. if [[ -n "${YARN_CONF_DIR}" ]]; then
  33. HADOOP_CONF_DIR="${YARN_CONF_DIR}"
  34. fi
  35. YARN_CONF_DIR="${HADOOP_CONF_DIR}"
  36. # YARN_CONF_DIR needs precedence over HADOOP_CONF_DIR
  37. # and the various jar dirs
  38. hadoop_add_classpath "${YARN_CONF_DIR}" before
  39. HADOOP_LOG_DIR="${YARN_LOG_DIR:-$HADOOP_LOG_DIR}"
  40. YARN_LOG_DIR="${HADOOP_LOG_DIR}"
  41. HADOOP_LOGFILE="${YARN_LOGFILE:-$HADOOP_LOGFILE}"
  42. YARN_LOGFILE="${HADOOP_LOGFILE}"
  43. HADOOP_NICENESS="${YARN_NICENESS:-$HADOOP_NICENESS}"
  44. YARN_NICENESS="${HADOOP_NICENESS}"
  45. HADOOP_STOP_TIMEOUT="${YARN_STOP_TIMEOUT:-$HADOOP_STOP_TIMEOUT}"
  46. YARN_STOP_TIMEOUT="${HADOOP_STOP_TIMEOUT}"
  47. HADOOP_PID_DIR="${YARN_PID_DIR:-$HADOOP_PID_DIR}"
  48. YARN_PID_DIR="${HADOOP_PID_DIR}"
  49. HADOOP_ROOT_LOGGER="${YARN_ROOT_LOGGER:-INFO,console}"
  50. YARN_ROOT_LOGGER="${HADOOP_ROOT_LOGGER}"
  51. HADOOP_YARN_HOME="${HADOOP_YARN_HOME:-$HADOOP_PREFIX}"
  52. HADOOP_IDENT_STRING="${YARN_IDENT_STRING:-$HADOOP_IDENT_STRING}"
  53. YARN_IDENT_STRING="${HADOOP_IDENT_STRING}"
  54. YARN_OPTS="${YARN_OPTS:-$HADOOP_OPTS}"
  55. # YARN-1429 added the completely superfluous YARN_USER_CLASSPATH
  56. # env var. We're going to override HADOOP_USER_CLASSPATH to keep
  57. # consistency with the rest of the duplicate/useless env vars
  58. HADOOP_USER_CLASSPATH="${YARN_USER_CLASSPATH:-$HADOOP_USER_CLASSPATH}"
  59. YARN_USER_CLASSPATH="${HADOOP_USER_CLASSPATH}"
  60. HADOOP_USER_CLASSPATH_FIRST="${YARN_USER_CLASSPATH_FIRST:-$HADOOP_USER_CLASSPATH_FIRST}"
  61. YARN_USER_CLASSPATH_FIRST="${HADOOP_USER_CLASSPATH_FIRST}"
  62. }
  63. if [[ -z "${HADOOP_LIBEXEC_DIR}" ]]; then
  64. _yc_this="${BASH_SOURCE-$0}"
  65. HADOOP_LIBEXEC_DIR=$(cd -P -- "$(dirname -- "${_yc_this}")" >/dev/null && pwd -P)
  66. fi
  67. if [[ -n "${HADOOP_COMMON_HOME}" ]] &&
  68. [[ -e "${HADOOP_COMMON_HOME}/libexec/hadoop-config.sh" ]]; then
  69. . "${HADOOP_COMMON_HOME}/libexec/hadoop-config.sh"
  70. elif [[ -e "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then
  71. . "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh"
  72. elif [ -e "${HADOOP_PREFIX}/libexec/hadoop-config.sh" ]; then
  73. . "${HADOOP_PREFIX}/libexec/hadoop-config.sh"
  74. else
  75. echo "ERROR: Hadoop common not found." 2>&1
  76. exit 1
  77. fi