rcc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. if [ -n "$HADOOP_HOME" ]; then
  30. DEFAULT_LIBEXEC_DIR="$HADOOP_HOME"/libexec
  31. fi
  32. HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
  33. . $HADOOP_LIBEXEC_DIR/hadoop-config.sh
  34. if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
  35. . "${HADOOP_CONF_DIR}/hadoop-env.sh"
  36. fi
  37. # some Java parameters
  38. if [ "$JAVA_HOME" != "" ]; then
  39. #echo "run java in $JAVA_HOME"
  40. JAVA_HOME=$JAVA_HOME
  41. fi
  42. if [ "$JAVA_HOME" = "" ]; then
  43. echo "Error: JAVA_HOME is not set."
  44. exit 1
  45. fi
  46. JAVA=$JAVA_HOME/bin/java
  47. JAVA_HEAP_MAX=-Xmx1000m
  48. # restore ordinary behaviour
  49. unset IFS
  50. CLASS='org.apache.hadoop.record.compiler.generated.Rcc'
  51. # run it
  52. exec "$JAVA" $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS "$@"