HADOOP-10040. Merging change r1531983 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1531984 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris Nauroth 2013-10-14 17:14:24 +00:00
parent 4e4e958213
commit a5467739bb
2 changed files with 297 additions and 297 deletions

10
.gitattributes vendored
View File

@ -13,8 +13,8 @@
*.sh text eol=lf *.sh text eol=lf
*.bat binary *.bat text eol=crlf
*.cmd binary *.cmd text eol=crlf
*.vcxproj binary *.vcxproj text merge=union eol=crlf
*.csproj binary *.csproj text merge=union eol=crlf
*.sln binary *.sln text merge=union eol=crlf

View File

@ -1,292 +1,292 @@
@echo off @echo off
@rem Licensed to the Apache Software Foundation (ASF) under one or more @rem Licensed to the Apache Software Foundation (ASF) under one or more
@rem contributor license agreements. See the NOTICE file distributed with @rem contributor license agreements. See the NOTICE file distributed with
@rem this work for additional information regarding copyright ownership. @rem this work for additional information regarding copyright ownership.
@rem The ASF licenses this file to You under the Apache License, Version 2.0 @rem The ASF licenses this file to You under the Apache License, Version 2.0
@rem (the "License"); you may not use this file except in compliance with @rem (the "License"); you may not use this file except in compliance with
@rem the License. You may obtain a copy of the License at @rem the License. You may obtain a copy of the License at
@rem @rem
@rem http://www.apache.org/licenses/LICENSE-2.0 @rem http://www.apache.org/licenses/LICENSE-2.0
@rem @rem
@rem Unless required by applicable law or agreed to in writing, software @rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS, @rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem included in all the hadoop scripts with source command @rem included in all the hadoop scripts with source command
@rem should not be executable directly @rem should not be executable directly
@rem also should not be passed any arguments, since we need original %* @rem also should not be passed any arguments, since we need original %*
if not defined HADOOP_COMMON_DIR ( if not defined HADOOP_COMMON_DIR (
set HADOOP_COMMON_DIR=share\hadoop\common set HADOOP_COMMON_DIR=share\hadoop\common
) )
if not defined HADOOP_COMMON_LIB_JARS_DIR ( if not defined HADOOP_COMMON_LIB_JARS_DIR (
set HADOOP_COMMON_LIB_JARS_DIR=share\hadoop\common\lib set HADOOP_COMMON_LIB_JARS_DIR=share\hadoop\common\lib
) )
if not defined HADOOP_COMMON_LIB_NATIVE_DIR ( if not defined HADOOP_COMMON_LIB_NATIVE_DIR (
set HADOOP_COMMON_LIB_NATIVE_DIR=lib\native set HADOOP_COMMON_LIB_NATIVE_DIR=lib\native
) )
if not defined HDFS_DIR ( if not defined HDFS_DIR (
set HDFS_DIR=share\hadoop\hdfs set HDFS_DIR=share\hadoop\hdfs
) )
if not defined HDFS_LIB_JARS_DIR ( if not defined HDFS_LIB_JARS_DIR (
set HDFS_LIB_JARS_DIR=share\hadoop\hdfs\lib set HDFS_LIB_JARS_DIR=share\hadoop\hdfs\lib
) )
if not defined YARN_DIR ( if not defined YARN_DIR (
set YARN_DIR=share\hadoop\yarn set YARN_DIR=share\hadoop\yarn
) )
if not defined YARN_LIB_JARS_DIR ( if not defined YARN_LIB_JARS_DIR (
set YARN_LIB_JARS_DIR=share\hadoop\yarn\lib set YARN_LIB_JARS_DIR=share\hadoop\yarn\lib
) )
if not defined MAPRED_DIR ( if not defined MAPRED_DIR (
set MAPRED_DIR=share\hadoop\mapreduce set MAPRED_DIR=share\hadoop\mapreduce
) )
if not defined MAPRED_LIB_JARS_DIR ( if not defined MAPRED_LIB_JARS_DIR (
set MAPRED_LIB_JARS_DIR=share\hadoop\mapreduce\lib set MAPRED_LIB_JARS_DIR=share\hadoop\mapreduce\lib
) )
@rem the root of the Hadoop installation @rem the root of the Hadoop installation
set HADOOP_HOME=%~dp0 set HADOOP_HOME=%~dp0
for %%i in (%HADOOP_HOME%.) do ( for %%i in (%HADOOP_HOME%.) do (
set HADOOP_HOME=%%~dpi set HADOOP_HOME=%%~dpi
) )
if "%HADOOP_HOME:~-1%" == "\" ( if "%HADOOP_HOME:~-1%" == "\" (
set HADOOP_HOME=%HADOOP_HOME:~0,-1% set HADOOP_HOME=%HADOOP_HOME:~0,-1%
) )
if not exist %HADOOP_HOME%\share\hadoop\common\hadoop-common-*.jar ( if not exist %HADOOP_HOME%\share\hadoop\common\hadoop-common-*.jar (
@echo +================================================================+ @echo +================================================================+
@echo ^| Error: HADOOP_HOME is not set correctly ^| @echo ^| Error: HADOOP_HOME is not set correctly ^|
@echo +----------------------------------------------------------------+ @echo +----------------------------------------------------------------+
@echo ^| Please set your HADOOP_HOME variable to the absolute path of ^| @echo ^| Please set your HADOOP_HOME variable to the absolute path of ^|
@echo ^| the directory that contains the hadoop distribution ^| @echo ^| the directory that contains the hadoop distribution ^|
@echo +================================================================+ @echo +================================================================+
exit /b 1 exit /b 1
) )
set HADOOP_CONF_DIR=%HADOOP_HOME%\etc\hadoop set HADOOP_CONF_DIR=%HADOOP_HOME%\etc\hadoop
@rem @rem
@rem Allow alternate conf dir location. @rem Allow alternate conf dir location.
@rem @rem
if "%1" == "--config" ( if "%1" == "--config" (
set HADOOP_CONF_DIR=%2 set HADOOP_CONF_DIR=%2
shift shift
shift shift
) )
@rem @rem
@rem check to see it is specified whether to use the slaves or the @rem check to see it is specified whether to use the slaves or the
@rem masters file @rem masters file
@rem @rem
if "%1" == "--hosts" ( if "%1" == "--hosts" (
set HADOOP_SLAVES=%HADOOP_CONF_DIR%\%2 set HADOOP_SLAVES=%HADOOP_CONF_DIR%\%2
shift shift
shift shift
) )
if exist %HADOOP_CONF_DIR%\hadoop-env.cmd ( if exist %HADOOP_CONF_DIR%\hadoop-env.cmd (
call %HADOOP_CONF_DIR%\hadoop-env.cmd call %HADOOP_CONF_DIR%\hadoop-env.cmd
) )
@rem @rem
@rem setup java environment variables @rem setup java environment variables
@rem @rem
if not defined JAVA_HOME ( if not defined JAVA_HOME (
echo Error: JAVA_HOME is not set. echo Error: JAVA_HOME is not set.
goto :eof goto :eof
) )
if not exist %JAVA_HOME%\bin\java.exe ( if not exist %JAVA_HOME%\bin\java.exe (
echo Error: JAVA_HOME is incorrectly set. echo Error: JAVA_HOME is incorrectly set.
echo Please update %HADOOP_HOME%\conf\hadoop-env.cmd echo Please update %HADOOP_HOME%\conf\hadoop-env.cmd
goto :eof goto :eof
) )
set JAVA=%JAVA_HOME%\bin\java set JAVA=%JAVA_HOME%\bin\java
@rem some Java parameters @rem some Java parameters
set JAVA_HEAP_MAX=-Xmx1000m set JAVA_HEAP_MAX=-Xmx1000m
@rem @rem
@rem check envvars which might override default args @rem check envvars which might override default args
@rem @rem
if defined HADOOP_HEAPSIZE ( if defined HADOOP_HEAPSIZE (
set JAVA_HEAP_MAX=-Xmx%HADOOP_HEAPSIZE%m set JAVA_HEAP_MAX=-Xmx%HADOOP_HEAPSIZE%m
) )
@rem @rem
@rem CLASSPATH initially contains %HADOOP_CONF_DIR% @rem CLASSPATH initially contains %HADOOP_CONF_DIR%
@rem @rem
set CLASSPATH=%HADOOP_CONF_DIR% set CLASSPATH=%HADOOP_CONF_DIR%
if not defined HADOOP_COMMON_HOME ( if not defined HADOOP_COMMON_HOME (
if exist %HADOOP_HOME%\share\hadoop\common ( if exist %HADOOP_HOME%\share\hadoop\common (
set HADOOP_COMMON_HOME=%HADOOP_HOME% set HADOOP_COMMON_HOME=%HADOOP_HOME%
) )
) )
@rem @rem
@rem for releases, add core hadoop jar & webapps to CLASSPATH @rem for releases, add core hadoop jar & webapps to CLASSPATH
@rem @rem
if exist %HADOOP_COMMON_HOME%\%HADOOP_COMMON_DIR%\webapps ( if exist %HADOOP_COMMON_HOME%\%HADOOP_COMMON_DIR%\webapps (
set CLASSPATH=!CLASSPATH!;%HADOOP_COMMON_HOME%\%HADOOP_COMMON_DIR% set CLASSPATH=!CLASSPATH!;%HADOOP_COMMON_HOME%\%HADOOP_COMMON_DIR%
) )
if exist %HADOOP_COMMON_HOME%\%HADOOP_COMMON_LIB_JARS_DIR% ( if exist %HADOOP_COMMON_HOME%\%HADOOP_COMMON_LIB_JARS_DIR% (
set CLASSPATH=!CLASSPATH!;%HADOOP_COMMON_HOME%\%HADOOP_COMMON_LIB_JARS_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_COMMON_HOME%\%HADOOP_COMMON_LIB_JARS_DIR%\*
) )
set CLASSPATH=!CLASSPATH!;%HADOOP_COMMON_HOME%\%HADOOP_COMMON_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_COMMON_HOME%\%HADOOP_COMMON_DIR%\*
@rem @rem
@rem default log directory % file @rem default log directory % file
@rem @rem
if not defined HADOOP_LOG_DIR ( if not defined HADOOP_LOG_DIR (
set HADOOP_LOG_DIR=%HADOOP_HOME%\logs set HADOOP_LOG_DIR=%HADOOP_HOME%\logs
) )
if not defined HADOOP_LOGFILE ( if not defined HADOOP_LOGFILE (
set HADOOP_LOGFILE=hadoop.log set HADOOP_LOGFILE=hadoop.log
) )
if not defined HADOOP_ROOT_LOGGER ( if not defined HADOOP_ROOT_LOGGER (
set HADOOP_ROOT_LOGGER=INFO,console set HADOOP_ROOT_LOGGER=INFO,console
) )
@rem @rem
@rem default policy file for service-level authorization @rem default policy file for service-level authorization
@rem @rem
if not defined HADOOP_POLICYFILE ( if not defined HADOOP_POLICYFILE (
set HADOOP_POLICYFILE=hadoop-policy.xml set HADOOP_POLICYFILE=hadoop-policy.xml
) )
@rem @rem
@rem Determine the JAVA_PLATFORM @rem Determine the JAVA_PLATFORM
@rem @rem
for /f "delims=" %%A in ('%JAVA% -Xmx32m %HADOOP_JAVA_PLATFORM_OPTS% -classpath "%CLASSPATH%" org.apache.hadoop.util.PlatformName') do set JAVA_PLATFORM=%%A for /f "delims=" %%A in ('%JAVA% -Xmx32m %HADOOP_JAVA_PLATFORM_OPTS% -classpath "%CLASSPATH%" org.apache.hadoop.util.PlatformName') do set JAVA_PLATFORM=%%A
@rem replace space with underscore @rem replace space with underscore
set JAVA_PLATFORM=%JAVA_PLATFORM: =_% set JAVA_PLATFORM=%JAVA_PLATFORM: =_%
@rem @rem
@rem setup 'java.library.path' for native hadoop code if necessary @rem setup 'java.library.path' for native hadoop code if necessary
@rem @rem
@rem Check if we're running hadoop directly from the build @rem Check if we're running hadoop directly from the build
set JAVA_LIBRARY_PATH= set JAVA_LIBRARY_PATH=
if exist %HADOOP_COMMON_HOME%\target\bin ( if exist %HADOOP_COMMON_HOME%\target\bin (
set JAVA_LIBRARY_PATH=%HADOOP_COMMON_HOME%\target\bin set JAVA_LIBRARY_PATH=%HADOOP_COMMON_HOME%\target\bin
) )
@rem For the distro case, check the bin folder @rem For the distro case, check the bin folder
if exist %HADOOP_COMMON_HOME%\bin ( if exist %HADOOP_COMMON_HOME%\bin (
set JAVA_LIBRARY_PATH=%JAVA_LIBRARY_PATH%;%HADOOP_COMMON_HOME%\bin set JAVA_LIBRARY_PATH=%JAVA_LIBRARY_PATH%;%HADOOP_COMMON_HOME%\bin
) )
@rem @rem
@rem setup a default TOOL_PATH @rem setup a default TOOL_PATH
@rem @rem
set TOOL_PATH=%HADOOP_HOME%\share\hadoop\tools\lib\* set TOOL_PATH=%HADOOP_HOME%\share\hadoop\tools\lib\*
set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.log.dir=%HADOOP_LOG_DIR% set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.log.dir=%HADOOP_LOG_DIR%
set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.log.file=%HADOOP_LOGFILE% set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.log.file=%HADOOP_LOGFILE%
set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.home.dir=%HADOOP_HOME% set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.home.dir=%HADOOP_HOME%
set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.id.str=%HADOOP_IDENT_STRING% set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.id.str=%HADOOP_IDENT_STRING%
set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.root.logger=%HADOOP_ROOT_LOGGER% set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.root.logger=%HADOOP_ROOT_LOGGER%
if defined JAVA_LIBRARY_PATH ( if defined JAVA_LIBRARY_PATH (
set HADOOP_OPTS=%HADOOP_OPTS% -Djava.library.path=%JAVA_LIBRARY_PATH% set HADOOP_OPTS=%HADOOP_OPTS% -Djava.library.path=%JAVA_LIBRARY_PATH%
) )
set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.policy.file=%HADOOP_POLICYFILE% set HADOOP_OPTS=%HADOOP_OPTS% -Dhadoop.policy.file=%HADOOP_POLICYFILE%
@rem @rem
@rem Disable ipv6 as it can cause issues @rem Disable ipv6 as it can cause issues
@rem @rem
set HADOOP_OPTS=%HADOOP_OPTS% -Djava.net.preferIPv4Stack=true set HADOOP_OPTS=%HADOOP_OPTS% -Djava.net.preferIPv4Stack=true
@rem @rem
@rem put hdfs in classpath if present @rem put hdfs in classpath if present
@rem @rem
if not defined HADOOP_HDFS_HOME ( if not defined HADOOP_HDFS_HOME (
if exist %HADOOP_HOME%\%HDFS_DIR% ( if exist %HADOOP_HOME%\%HDFS_DIR% (
set HADOOP_HDFS_HOME=%HADOOP_HOME% set HADOOP_HDFS_HOME=%HADOOP_HOME%
) )
) )
if exist %HADOOP_HDFS_HOME%\%HDFS_DIR%\webapps ( if exist %HADOOP_HDFS_HOME%\%HDFS_DIR%\webapps (
set CLASSPATH=!CLASSPATH!;%HADOOP_HDFS_HOME%\%HDFS_DIR% set CLASSPATH=!CLASSPATH!;%HADOOP_HDFS_HOME%\%HDFS_DIR%
) )
if exist %HADOOP_HDFS_HOME%\%HDFS_LIB_JARS_DIR% ( if exist %HADOOP_HDFS_HOME%\%HDFS_LIB_JARS_DIR% (
set CLASSPATH=!CLASSPATH!;%HADOOP_HDFS_HOME%\%HDFS_LIB_JARS_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_HDFS_HOME%\%HDFS_LIB_JARS_DIR%\*
) )
set CLASSPATH=!CLASSPATH!;%HADOOP_HDFS_HOME%\%HDFS_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_HDFS_HOME%\%HDFS_DIR%\*
@rem @rem
@rem put yarn in classpath if present @rem put yarn in classpath if present
@rem @rem
if not defined HADOOP_YARN_HOME ( if not defined HADOOP_YARN_HOME (
if exist %HADOOP_HOME%\%YARN_DIR% ( if exist %HADOOP_HOME%\%YARN_DIR% (
set HADOOP_YARN_HOME=%HADOOP_HOME% set HADOOP_YARN_HOME=%HADOOP_HOME%
) )
) )
if exist %HADOOP_YARN_HOME%\%YARN_DIR%\webapps ( if exist %HADOOP_YARN_HOME%\%YARN_DIR%\webapps (
set CLASSPATH=!CLASSPATH!;%HADOOP_YARN_HOME%\%YARN_DIR% set CLASSPATH=!CLASSPATH!;%HADOOP_YARN_HOME%\%YARN_DIR%
) )
if exist %HADOOP_YARN_HOME%\%YARN_LIB_JARS_DIR% ( if exist %HADOOP_YARN_HOME%\%YARN_LIB_JARS_DIR% (
set CLASSPATH=!CLASSPATH!;%HADOOP_YARN_HOME%\%YARN_LIB_JARS_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_YARN_HOME%\%YARN_LIB_JARS_DIR%\*
) )
set CLASSPATH=!CLASSPATH!;%HADOOP_YARN_HOME%\%YARN_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_YARN_HOME%\%YARN_DIR%\*
@rem @rem
@rem put mapred in classpath if present AND different from YARN @rem put mapred in classpath if present AND different from YARN
@rem @rem
if not defined HADOOP_MAPRED_HOME ( if not defined HADOOP_MAPRED_HOME (
if exist %HADOOP_HOME%\%MAPRED_DIR% ( if exist %HADOOP_HOME%\%MAPRED_DIR% (
set HADOOP_MAPRED_HOME=%HADOOP_HOME% set HADOOP_MAPRED_HOME=%HADOOP_HOME%
) )
) )
if not "%HADOOP_MAPRED_HOME%\%MAPRED_DIR%" == "%HADOOP_YARN_HOME%\%YARN_DIR%" ( if not "%HADOOP_MAPRED_HOME%\%MAPRED_DIR%" == "%HADOOP_YARN_HOME%\%YARN_DIR%" (
if exist %HADOOP_MAPRED_HOME%\%MAPRED_DIR%\webapps ( if exist %HADOOP_MAPRED_HOME%\%MAPRED_DIR%\webapps (
set CLASSPATH=!CLASSPATH!;%HADOOP_MAPRED_HOME%\%MAPRED_DIR% set CLASSPATH=!CLASSPATH!;%HADOOP_MAPRED_HOME%\%MAPRED_DIR%
) )
if exist %HADOOP_MAPRED_HOME%\%MAPRED_LIB_JARS_DIR% ( if exist %HADOOP_MAPRED_HOME%\%MAPRED_LIB_JARS_DIR% (
set CLASSPATH=!CLASSPATH!;%HADOOP_MAPRED_HOME%\%MAPRED_LIB_JARS_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_MAPRED_HOME%\%MAPRED_LIB_JARS_DIR%\*
) )
set CLASSPATH=!CLASSPATH!;%HADOOP_MAPRED_HOME%\%MAPRED_DIR%\* set CLASSPATH=!CLASSPATH!;%HADOOP_MAPRED_HOME%\%MAPRED_DIR%\*
) )
@rem @rem
@rem add user-specified CLASSPATH last @rem add user-specified CLASSPATH last
@rem @rem
if defined HADOOP_CLASSPATH ( if defined HADOOP_CLASSPATH (
if defined HADOOP_USER_CLASSPATH_FIRST ( if defined HADOOP_USER_CLASSPATH_FIRST (
set CLASSPATH=%HADOOP_CLASSPATH%;%CLASSPATH%; set CLASSPATH=%HADOOP_CLASSPATH%;%CLASSPATH%;
) else ( ) else (
set CLASSPATH=%CLASSPATH%;%HADOOP_CLASSPATH%; set CLASSPATH=%CLASSPATH%;%HADOOP_CLASSPATH%;
) )
) )
:eof :eof