source: nutchez-0.1/bin/rcc @ 95

Last change on this file since 95 was 66, checked in by waue, 16 years ago

NutchEz - an easy way to nutch

  • Property svn:executable set to *
File size: 2.6 KB
RevLine 
[66]1#!/usr/bin/env bash
2
3# Licensed to the Apache Software Foundation (ASF) under one or more
4# contributor license agreements.  See the NOTICE file distributed with
5# this work for additional information regarding copyright ownership.
6# The ASF licenses this file to You under the Apache License, Version 2.0
7# (the "License"); you may not use this file except in compliance with
8# the License.  You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18
19# The Hadoop record compiler
20#
21# Environment Variables
22#
23#   JAVA_HOME        The java implementation to use.  Overrides JAVA_HOME.
24#
25#   HADOOP_OPTS      Extra Java runtime options.
26#
27#   HADOOP_CONF_DIR  Alternate conf dir. Default is ${HADOOP_HOME}/conf.
28#
29
30bin=`dirname "$0"`
31bin=`cd "$bin"; pwd`
32
33. "$bin"/hadoop-config.sh
34
35if [ -f "${HADOOP_CONF_DIR}/hadoop-env.sh" ]; then
36  . "${HADOOP_CONF_DIR}/hadoop-env.sh"
37fi
38
39# some Java parameters
40if [ "$JAVA_HOME" != "" ]; then
41  #echo "run java in $JAVA_HOME"
42  JAVA_HOME=$JAVA_HOME
43fi
44 
45if [ "$JAVA_HOME" = "" ]; then
46  echo "Error: JAVA_HOME is not set."
47  exit 1
48fi
49
50JAVA=$JAVA_HOME/bin/java
51JAVA_HEAP_MAX=-Xmx1000m
52
53# CLASSPATH initially contains $HADOOP_CONF_DIR
54CLASSPATH="${HADOOP_CONF_DIR}"
55CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
56
57# for developers, add Hadoop classes to CLASSPATH
58if [ -d "$HADOOP_HOME/build/classes" ]; then
59  CLASSPATH=${CLASSPATH}:$HADOOP_HOME/build/classes
60fi
61if [ -d "$HADOOP_HOME/build/webapps" ]; then
62  CLASSPATH=${CLASSPATH}:$HADOOP_HOME/build
63fi
64if [ -d "$HADOOP_HOME/build/test/classes" ]; then
65  CLASSPATH=${CLASSPATH}:$HADOOP_HOME/build/test/classes
66fi
67
68# so that filenames w/ spaces are handled correctly in loops below
69IFS=
70
71# for releases, add core hadoop jar & webapps to CLASSPATH
72if [ -d "$HADOOP_HOME/webapps" ]; then
73  CLASSPATH=${CLASSPATH}:$HADOOP_HOME
74fi
75for f in $HADOOP_HOME/hadoop-*-core.jar; do
76  CLASSPATH=${CLASSPATH}:$f;
77done
78
79# add libs to CLASSPATH
80for f in $HADOOP_HOME/lib/*.jar; do
81  CLASSPATH=${CLASSPATH}:$f;
82done
83
84for f in $HADOOP_HOME/lib/jetty-ext/*.jar; do
85  CLASSPATH=${CLASSPATH}:$f;
86done
87
88# restore ordinary behaviour
89unset IFS
90
91CLASS='org.apache.hadoop.record.compiler.generated.Rcc'
92
93# cygwin path translation
94if expr `uname` : 'CYGWIN*' > /dev/null; then
95  CLASSPATH=`cygpath -p -w "$CLASSPATH"`
96fi
97
98# run it
99exec "$JAVA" $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS "$@"
Note: See TracBrowser for help on using the repository browser.