yarn.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. hadoop_add_profile yarn
  16. function _yarn_hadoop_classpath
  17. {
  18. local i
  19. #
  20. # get all of the yarn jars+config in the path
  21. #
  22. # developers
  23. if [[ -n "${HADOOP_ENABLE_BUILD_PATHS}" ]]; then
  24. for i in yarn-api yarn-common yarn-mapreduce yarn-master-worker \
  25. yarn-server/yarn-server-nodemanager \
  26. yarn-server/yarn-server-common \
  27. yarn-server/yarn-server-resourcemanager; do
  28. hadoop_add_classpath "${HADOOP_YARN_HOME}/$i/target/classes"
  29. done
  30. hadoop_add_classpath "${HADOOP_YARN_HOME}/build/test/classes"
  31. hadoop_add_classpath "${HADOOP_YARN_HOME}/build/tools"
  32. fi
  33. if [[ -d "${HADOOP_YARN_HOME}/${YARN_DIR}/webapps" ]]; then
  34. hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_DIR}"
  35. fi
  36. hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}"'/*'
  37. hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_DIR}"'/*'
  38. }
  39. function _yarn_hadoop_finalize
  40. {
  41. # Add YARN custom options to comamnd line in case someone actaully
  42. # used these.
  43. #
  44. # Note that we are replacing ' ' with '\ ' so that when we exec
  45. # stuff it works
  46. #
  47. local yld=$HADOOP_LOG_DIR
  48. hadoop_translate_cygwin_path yld
  49. hadoop_add_param HADOOP_OPTS yarn.log.dir "-Dyarn.log.dir=${yld}"
  50. hadoop_add_param HADOOP_OPTS yarn.log.file "-Dyarn.log.file=${HADOOP_LOGFILE}"
  51. local yhd=$HADOOP_YARN_HOME
  52. hadoop_translate_cygwin_path yhd
  53. hadoop_add_param HADOOP_OPTS yarn.home.dir "-Dyarn.home.dir=${yhd}"
  54. hadoop_add_param HADOOP_OPTS yarn.root.logger "-Dyarn.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
  55. }