hadoop-yarn.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env bash
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. hadoop_add_profile yarn
  17. function _yarn_hadoop_classpath
  18. {
  19. local i
  20. #
  21. # get all of the yarn jars+config in the path
  22. #
  23. # developers
  24. if [[ -n "${HADOOP_ENABLE_BUILD_PATHS}" ]]; then
  25. for i in yarn-api yarn-common yarn-mapreduce yarn-master-worker \
  26. yarn-server/yarn-server-nodemanager \
  27. yarn-server/yarn-server-common \
  28. yarn-server/yarn-server-resourcemanager; do
  29. hadoop_add_classpath "${HADOOP_YARN_HOME}/$i/target/classes"
  30. done
  31. hadoop_add_classpath "${HADOOP_YARN_HOME}/build/test/classes"
  32. hadoop_add_classpath "${HADOOP_YARN_HOME}/build/tools"
  33. fi
  34. if [[ -d "${HADOOP_YARN_HOME}/${YARN_DIR}/webapps" ]]; then
  35. hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_DIR}"
  36. fi
  37. hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}"'/*'
  38. hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_DIR}"'/*'
  39. }
  40. function _yarn_hadoop_finalize
  41. {
  42. # Add YARN custom options to comamnd line in case someone actaully
  43. # used these.
  44. #
  45. # Note that we are replacing ' ' with '\ ' so that when we exec
  46. # stuff it works
  47. #
  48. local yld=$HADOOP_LOG_DIR
  49. hadoop_translate_cygwin_path yld
  50. hadoop_add_param HADOOP_OPTS yarn.log.dir "-Dyarn.log.dir=${yld}"
  51. hadoop_add_param HADOOP_OPTS yarn.log.file "-Dyarn.log.file=${HADOOP_LOGFILE}"
  52. local yhd=$HADOOP_YARN_HOME
  53. hadoop_translate_cygwin_path yhd
  54. hadoop_add_param HADOOP_OPTS yarn.home.dir "-Dyarn.home.dir=${yhd}"
  55. hadoop_add_param HADOOP_OPTS yarn.root.logger "-Dyarn.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
  56. }