rcc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # The Hadoop record compiler
  17. #
  18. # Environment Variables
  19. #
  20. # JAVA_HOME The java implementation to use. Overrides JAVA_HOME.
  21. #
  22. # HADOOP_OPTS Extra Java runtime options.
  23. #
  24. # HADOOP_CONF_DIR Alternate conf dir. Default is ${HADOOP_PREFIX}/conf.
  25. #
  26. bin=`dirname "${BASH_SOURCE-$0}"`
  27. bin=`cd "$bin"; pwd`
  28. DEFAULT_LIBEXEC_DIR="$bin"/../libexec
  29. HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
  30. . $HADOOP_LIBEXEC_DIR/hadoop-config.sh
  31. if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
  32. . "${HADOOP_CONF_DIR}/hadoop-env.sh"
  33. fi
  34. # some Java parameters
  35. if [ "$JAVA_HOME" != "" ]; then
  36. #echo "run java in $JAVA_HOME"
  37. JAVA_HOME=$JAVA_HOME
  38. fi
  39. if [ "$JAVA_HOME" = "" ]; then
  40. echo "Error: JAVA_HOME is not set."
  41. exit 1
  42. fi
  43. JAVA=$JAVA_HOME/bin/java
  44. JAVA_HEAP_MAX=-Xmx1000m
  45. # restore ordinary behaviour
  46. unset IFS
  47. CLASS='org.apache.hadoop.record.compiler.generated.Rcc'
  48. # run it
  49. exec "$JAVA" $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS "$@"