yarn-config.sh 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 [[ -e "${YARN_CONF_DIR}/yarn-env.sh" ]]; then
  25. . "${YARN_CONF_DIR}/yarn-env.sh"
  26. elif [[ -e "${HADOOP_CONF_DIR}/yarn-env.sh" ]]; then
  27. . "${HADOOP_CONF_DIR}/yarn-env.sh"
  28. fi
  29. if [[ -n "${YARN_CONF_DIR}" ]]; then
  30. HADOOP_CONF_DIR="${YARN_CONF_DIR}"
  31. fi
  32. YARN_CONF_DIR="${HADOOP_CONF_DIR}"
  33. # YARN_CONF_DIR needs precedence over HADOOP_CONF_DIR
  34. # and the various jar dirs
  35. hadoop_add_classpath "${YARN_CONF_DIR}" before
  36. HADOOP_LOG_DIR="${YARN_LOG_DIR:-$HADOOP_LOG_DIR}"
  37. YARN_LOG_DIR="${HADOOP_LOG_DIR}"
  38. HADOOP_LOGFILE="${YARN_LOGFILE:-$HADOOP_LOGFILE}"
  39. YARN_LOGFILE="${HADOOP_LOGFILE}"
  40. HADOOP_NICENESS="${YARN_NICENESS:-$HADOOP_NICENESS}"
  41. YARN_NICENESS="${HADOOP_NICENESS}"
  42. HADOOP_STOP_TIMEOUT="${YARN_STOP_TIMEOUT:-$HADOOP_STOP_TIMEOUT}"
  43. YARN_STOP_TIMEOUT="${HADOOP_STOP_TIMEOUT}"
  44. HADOOP_PID_DIR="${YARN_PID_DIR:-$HADOOP_PID_DIR}"
  45. YARN_PID_DIR="${HADOOP_PID_DIR}"
  46. HADOOP_ROOT_LOGGER="${YARN_ROOT_LOGGER:-INFO,console}"
  47. YARN_ROOT_LOGGER="${HADOOP_ROOT_LOGGER}"
  48. HADOOP_YARN_HOME="${HADOOP_YARN_HOME:-$HADOOP_PREFIX}"
  49. HADOOP_IDENT_STRING="${YARN_IDENT_STRING:-$HADOOP_IDENT_STRING}"
  50. YARN_IDENT_STRING="${HADOOP_IDENT_STRING}"
  51. YARN_OPTS="${YARN_OPTS:-$HADOOP_OPTS}"
  52. # YARN-1429 added the completely superfluous YARN_USER_CLASSPATH
  53. # env var. We're going to override HADOOP_USER_CLASSPATH to keep
  54. # consistency with the rest of the duplicate/useless env vars
  55. HADOOP_USER_CLASSPATH="${YARN_USER_CLASSPATH:-$HADOOP_USER_CLASSPATH}"
  56. YARN_USER_CLASSPATH="${HADOOP_USER_CLASSPATH}"
  57. HADOOP_USER_CLASSPATH_FIRST="${YARN_USER_CLASSPATH_FIRST:-$HADOOP_USER_CLASSPATH_FIRST}"
  58. YARN_USER_CLASSPATH_FIRST="${HADOOP_USER_CLASSPATH_FIRST}"
  59. }
  60. if [[ -z "${HADOOP_LIBEXEC_DIR}" ]]; then
  61. _yc_this="${BASH_SOURCE-$0}"
  62. HADOOP_LIBEXEC_DIR=$(cd -P -- "$(dirname -- "${_yc_this}")" >/dev/null && pwd -P)
  63. fi
  64. if [[ -e "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then
  65. . "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh"
  66. elif [[ -e "${HADOOP_COMMON_HOME}/libexec/hadoop-config.sh" ]]; then
  67. . "${HADOOP_COMMON_HOME}/libexec/hadoop-config.sh"
  68. elif [[ -e "${HADOOP_HOME}/libexec/hadoop-config.sh" ]]; then
  69. . "${HADOOP_HOME}/libexec/hadoop-config.sh"
  70. else
  71. echo "Hadoop common not found."
  72. exit
  73. fi