Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge from trunk to branch
Browse files Browse the repository at this point in the history
  • Loading branch information
umbrant committed Aug 5, 2014
2 parents 84dcec0 + 362bc16 commit 112aa8b
Show file tree
Hide file tree
Showing 201 changed files with 7,258 additions and 1,950 deletions.
32 changes: 32 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Expand Up @@ -192,6 +192,11 @@ Trunk (Unreleased)
HADOOP-10891. Add EncryptedKeyVersion factory method to
KeyProviderCryptoExtension. (wang)

HADOOP-10756. KMS audit log should consolidate successful similar requests.
(asuresh via tucu)

HADOOP-10793. KeyShell args should use single-dash style. (wang)

BUG FIXES

HADOOP-9451. Fault single-layer config if node group topology is enabled.
Expand Down Expand Up @@ -405,6 +410,12 @@ Trunk (Unreleased)
HADOOP-10881. Clarify usage of encryption and encrypted encryption
key in KeyProviderCryptoExtension. (wang)

HADOOP-10920. site plugin couldn't parse hadoop-kms index.apt.vm.
(Akira Ajisaka via wang)

HADOOP-10925. Compilation fails in native link0 function on Windows.
(cnauroth)

OPTIMIZATIONS

HADOOP-7761. Improve the performance of raw comparisons. (todd)
Expand Down Expand Up @@ -463,6 +474,14 @@ Release 2.6.0 - UNRELEASED
HADOOP-8069. Enable TCP_NODELAY by default for IPC. (Todd Lipcon via
Arpit Agarwal)

HADOOP-10902. Deletion of directories with snapshots will not output
reason for trash move failure. (Stephen Chu via wang)

HADOOP-10900. CredentialShell args should use single-dash style. (wang)

HADOOP-10903. Enhance hadoop classpath command to expand wildcards or write
classpath into jar manifest. (cnauroth)

OPTIMIZATIONS

BUG FIXES
Expand Down Expand Up @@ -497,6 +516,15 @@ Release 2.6.0 - UNRELEASED
HADOOP-10876. The constructor of Path should not take an empty URL as a
parameter. (Zhihai Xu via wang)

HADOOP-10928. Incorrect usage on `hadoop credential list`.
(Josh Elser via wang)

HADOOP-10927. Fix CredentialShell help behavior and error codes.
(Josh Elser via wang)

HADOOP-10937. Need to set version name correctly before decrypting EEK.
(Arun Suresh via wang)

Release 2.5.0 - UNRELEASED

INCOMPATIBLE CHANGES
Expand Down Expand Up @@ -637,6 +665,8 @@ Release 2.5.0 - UNRELEASED

BUG FIXES

HADOOP-10759. Remove hardcoded JAVA_HEAP_MAX. (Sam Liu via Eric Yang)

HADOOP-10378. Typo in help printed by hdfs dfs -help.
(Mit Desai via suresh)

Expand Down Expand Up @@ -813,6 +843,8 @@ Release 2.5.0 - UNRELEASED
HADOOP-10894. Fix dead link in ToolRunner documentation. (Akira Ajisaka
via Arpit Agarwal)

HADOOP-10910. Increase findbugs maxHeap size. (wang)

BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS

HADOOP-10520. Extended attributes definition and FileSystem APIs for
Expand Down
14 changes: 9 additions & 5 deletions hadoop-common-project/hadoop-common/src/main/bin/hadoop
Expand Up @@ -35,6 +35,7 @@ function print_usage(){
echo " distcp <srcurl> <desturl> copy file or directories recursively"
echo " archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive"
echo " classpath prints the class path needed to get the"
echo " credential interact with credential providers"
echo " Hadoop jar and the required libraries"
echo " daemonlog get/set the log level for each daemon"
echo " or"
Expand Down Expand Up @@ -90,11 +91,6 @@ case $COMMAND in
fi
;;

classpath)
echo $CLASSPATH
exit
;;

#core commands
*)
# the core commands
Expand All @@ -118,6 +114,14 @@ case $COMMAND in
CLASSPATH=${CLASSPATH}:${TOOL_PATH}
elif [ "$COMMAND" = "credential" ] ; then
CLASS=org.apache.hadoop.security.alias.CredentialShell
elif [ "$COMMAND" = "classpath" ] ; then
if [ "$#" -eq 1 ]; then
# No need to bother starting up a JVM for this simple case.
echo $CLASSPATH
exit
else
CLASS=org.apache.hadoop.util.Classpath
fi
elif [[ "$COMMAND" = -* ]] ; then
# class and package names cannot begin with a -
echo "Error: No command named \`$COMMAND' was found. Perhaps you meant \`hadoop ${COMMAND#-}'"
Expand Down
Expand Up @@ -149,8 +149,6 @@ if [[ -z $JAVA_HOME ]]; then
fi

JAVA=$JAVA_HOME/bin/java
# some Java parameters
JAVA_HEAP_MAX=-Xmx1000m

# check envvars which might override default args
if [ "$HADOOP_HEAPSIZE" != "" ]; then
Expand Down
13 changes: 10 additions & 3 deletions hadoop-common-project/hadoop-common/src/main/bin/hadoop.cmd
Expand Up @@ -115,11 +115,14 @@ call :updatepath %HADOOP_BIN_PATH%
)

if %hadoop-command% == classpath (
@echo %CLASSPATH%
goto :eof
if not defined hadoop-command-arguments (
@rem No need to bother starting up a JVM for this simple case.
@echo %CLASSPATH%
exit /b
)
)

set corecommands=fs version jar checknative distcp daemonlog archive
set corecommands=fs version jar checknative distcp daemonlog archive classpath
for %%i in ( %corecommands% ) do (
if %hadoop-command% == %%i set corecommand=true
)
Expand Down Expand Up @@ -175,6 +178,10 @@ call :updatepath %HADOOP_BIN_PATH%
set CLASSPATH=%CLASSPATH%;%TOOL_PATH%
goto :eof

:classpath
set CLASS=org.apache.hadoop.util.Classpath
goto :eof

:updatepath
set path_to_add=%*
set current_path_comparable=%path%
Expand Down
Expand Up @@ -1843,6 +1843,38 @@ protected char[] getPasswordFromConfig(String name) {
return pass;
}

/**
* Get the socket address for <code>hostProperty</code> as a
* <code>InetSocketAddress</code>. If <code>hostProperty</code> is
* <code>null</code>, <code>addressProperty</code> will be used. This
* is useful for cases where we want to differentiate between host
* bind address and address clients should use to establish connection.
*
* @param hostProperty bind host property name.
* @param addressProperty address property name.
* @param defaultAddressValue the default value
* @param defaultPort the default port
* @return InetSocketAddress
*/
public InetSocketAddress getSocketAddr(
String hostProperty,
String addressProperty,
String defaultAddressValue,
int defaultPort) {

InetSocketAddress bindAddr = getSocketAddr(
addressProperty, defaultAddressValue, defaultPort);

final String host = get(hostProperty);

if (host == null || host.isEmpty()) {
return bindAddr;
}

return NetUtils.createSocketAddr(
host, bindAddr.getPort(), hostProperty);
}

/**
* Get the socket address for <code>name</code> property as a
* <code>InetSocketAddress</code>.
Expand All @@ -1864,6 +1896,40 @@ public InetSocketAddress getSocketAddr(
public void setSocketAddr(String name, InetSocketAddress addr) {
set(name, NetUtils.getHostPortString(addr));
}

/**
* Set the socket address a client can use to connect for the
* <code>name</code> property as a <code>host:port</code>. The wildcard
* address is replaced with the local host's address. If the host and address
* properties are configured the host component of the address will be combined
* with the port component of the addr to generate the address. This is to allow
* optional control over which host name is used in multi-home bind-host
* cases where a host can have multiple names
* @param hostProperty the bind-host configuration name
* @param addressProperty the service address configuration name
* @param defaultAddressValue the service default address configuration value
* @param addr InetSocketAddress of the service listener
* @return InetSocketAddress for clients to connect
*/
public InetSocketAddress updateConnectAddr(
String hostProperty,
String addressProperty,
String defaultAddressValue,
InetSocketAddress addr) {

final String host = get(hostProperty);
final String connectHostPort = getTrimmed(addressProperty, defaultAddressValue);

if (host == null || host.isEmpty() || connectHostPort == null || connectHostPort.isEmpty()) {
//not our case, fall back to original logic
return updateConnectAddr(addressProperty, addr);
}

final String connectHost = connectHostPort.split(":")[0];
// Create connect address using client address hostname and server port.
return updateConnectAddr(addressProperty, NetUtils.createSocketAddrForHost(
connectHost, addr.getPort()));
}

/**
* Set the socket address a client can use to connect for the
Expand Down
Expand Up @@ -21,11 +21,13 @@
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;

import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import com.google.common.base.Preconditions;

import org.apache.hadoop.classification.InterfaceAudience;

/**
Expand Down Expand Up @@ -97,7 +99,7 @@ protected EncryptedKeyVersion(String keyName,
public static EncryptedKeyVersion createForDecryption(String
encryptionKeyVersionName, byte[] encryptedKeyIv,
byte[] encryptedKeyMaterial) {
KeyVersion encryptedKeyVersion = new KeyVersion(null, null,
KeyVersion encryptedKeyVersion = new KeyVersion(null, EEK,
encryptedKeyMaterial);
return new EncryptedKeyVersion(null, encryptionKeyVersionName,
encryptedKeyIv, encryptedKeyVersion);
Expand Down Expand Up @@ -258,6 +260,13 @@ public KeyVersion decryptEncryptedKey(
keyProvider.getKeyVersion(encryptionKeyVersionName);
Preconditions.checkNotNull(encryptionKey,
"KeyVersion name '%s' does not exist", encryptionKeyVersionName);
Preconditions.checkArgument(
encryptedKeyVersion.getEncryptedKeyVersion().getVersionName()
.equals(KeyProviderCryptoExtension.EEK),
"encryptedKey version name must be '%s', is '%s'",
KeyProviderCryptoExtension.EEK,
encryptedKeyVersion.getEncryptedKeyVersion().getVersionName()
);
final byte[] encryptionKeyMaterial = encryptionKey.getMaterial();
// Encryption key IV is determined from encrypted key's IV
final byte[] encryptionIV =
Expand Down

0 comments on commit 112aa8b

Please sign in to comment.