Skip to content

Commit 7628007

Browse files
committed
Add hadoop 2.6.3 binaries
1 parent 148abf7 commit 7628007

File tree

10 files changed

+1914
-0
lines changed

10 files changed

+1914
-0
lines changed

hadoop-2.6.3/bin/hadoop

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
# This script runs the hadoop core commands.
19+
20+
bin=`which $0`
21+
bin=`dirname ${bin}`
22+
bin=`cd "$bin"; pwd`
23+
24+
DEFAULT_LIBEXEC_DIR="$bin"/../libexec
25+
HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
26+
. $HADOOP_LIBEXEC_DIR/hadoop-config.sh
27+
28+
function print_usage(){
29+
echo "Usage: hadoop [--config confdir] COMMAND"
30+
echo " where COMMAND is one of:"
31+
echo " fs run a generic filesystem user client"
32+
echo " version print the version"
33+
echo " jar <jar> run a jar file"
34+
echo " checknative [-a|-h] check native hadoop and compression libraries availability"
35+
echo " distcp <srcurl> <desturl> copy file or directories recursively"
36+
echo " archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive"
37+
echo " classpath prints the class path needed to get the"
38+
echo " credential interact with credential providers"
39+
echo " Hadoop jar and the required libraries"
40+
echo " daemonlog get/set the log level for each daemon"
41+
echo " trace view and modify Hadoop tracing settings"
42+
echo " or"
43+
echo " CLASSNAME run the class named CLASSNAME"
44+
echo ""
45+
echo "Most commands print help when invoked w/o parameters."
46+
}
47+
48+
if [ $# = 0 ]; then
49+
print_usage
50+
exit
51+
fi
52+
53+
COMMAND=$1
54+
case $COMMAND in
55+
# usage flags
56+
--help|-help|-h)
57+
print_usage
58+
exit
59+
;;
60+
61+
#hdfs commands
62+
namenode|secondarynamenode|datanode|dfs|dfsadmin|fsck|balancer|fetchdt|oiv|dfsgroups|portmap|nfs3)
63+
echo "DEPRECATED: Use of this script to execute hdfs command is deprecated." 1>&2
64+
echo "Instead use the hdfs command for it." 1>&2
65+
echo "" 1>&2
66+
#try to locate hdfs and if present, delegate to it.
67+
shift
68+
if [ -f "${HADOOP_HDFS_HOME}"/bin/hdfs ]; then
69+
exec "${HADOOP_HDFS_HOME}"/bin/hdfs ${COMMAND/dfsgroups/groups} "$@"
70+
elif [ -f "${HADOOP_PREFIX}"/bin/hdfs ]; then
71+
exec "${HADOOP_PREFIX}"/bin/hdfs ${COMMAND/dfsgroups/groups} "$@"
72+
else
73+
echo "HADOOP_HDFS_HOME not found!"
74+
exit 1
75+
fi
76+
;;
77+
78+
#mapred commands for backwards compatibility
79+
pipes|job|queue|mrgroups|mradmin|jobtracker|tasktracker)
80+
echo "DEPRECATED: Use of this script to execute mapred command is deprecated." 1>&2
81+
echo "Instead use the mapred command for it." 1>&2
82+
echo "" 1>&2
83+
#try to locate mapred and if present, delegate to it.
84+
shift
85+
if [ -f "${HADOOP_MAPRED_HOME}"/bin/mapred ]; then
86+
exec "${HADOOP_MAPRED_HOME}"/bin/mapred ${COMMAND/mrgroups/groups} "$@"
87+
elif [ -f "${HADOOP_PREFIX}"/bin/mapred ]; then
88+
exec "${HADOOP_PREFIX}"/bin/mapred ${COMMAND/mrgroups/groups} "$@"
89+
else
90+
echo "HADOOP_MAPRED_HOME not found!"
91+
exit 1
92+
fi
93+
;;
94+
95+
#core commands
96+
*)
97+
# the core commands
98+
if [ "$COMMAND" = "fs" ] ; then
99+
CLASS=org.apache.hadoop.fs.FsShell
100+
elif [ "$COMMAND" = "version" ] ; then
101+
CLASS=org.apache.hadoop.util.VersionInfo
102+
elif [ "$COMMAND" = "jar" ] ; then
103+
CLASS=org.apache.hadoop.util.RunJar
104+
elif [ "$COMMAND" = "key" ] ; then
105+
CLASS=org.apache.hadoop.crypto.key.KeyShell
106+
elif [ "$COMMAND" = "checknative" ] ; then
107+
CLASS=org.apache.hadoop.util.NativeLibraryChecker
108+
elif [ "$COMMAND" = "distcp" ] ; then
109+
CLASS=org.apache.hadoop.tools.DistCp
110+
CLASSPATH=${CLASSPATH}:${TOOL_PATH}
111+
elif [ "$COMMAND" = "daemonlog" ] ; then
112+
CLASS=org.apache.hadoop.log.LogLevel
113+
elif [ "$COMMAND" = "archive" ] ; then
114+
CLASS=org.apache.hadoop.tools.HadoopArchives
115+
CLASSPATH=${CLASSPATH}:${TOOL_PATH}
116+
elif [ "$COMMAND" = "credential" ] ; then
117+
CLASS=org.apache.hadoop.security.alias.CredentialShell
118+
elif [ "$COMMAND" = "trace" ] ; then
119+
CLASS=org.apache.hadoop.tracing.TraceAdmin
120+
elif [ "$COMMAND" = "classpath" ] ; then
121+
if [ "$#" -eq 1 ]; then
122+
# No need to bother starting up a JVM for this simple case.
123+
echo $CLASSPATH
124+
exit
125+
else
126+
CLASS=org.apache.hadoop.util.Classpath
127+
fi
128+
elif [[ "$COMMAND" = -* ]] ; then
129+
# class and package names cannot begin with a -
130+
echo "Error: No command named \`$COMMAND' was found. Perhaps you meant \`hadoop ${COMMAND#-}'"
131+
exit 1
132+
else
133+
CLASS=$COMMAND
134+
fi
135+
shift
136+
137+
# Always respect HADOOP_OPTS and HADOOP_CLIENT_OPTS
138+
HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"
139+
140+
#make sure security appender is turned off
141+
HADOOP_OPTS="$HADOOP_OPTS -Dhadoop.security.logger=${HADOOP_SECURITY_LOGGER:-INFO,NullAppender}"
142+
143+
export CLASSPATH=$CLASSPATH
144+
exec "$JAVA" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@"
145+
;;
146+
147+
esac

0 commit comments

Comments
 (0)