Skip to content

Commit

Permalink
Merge trunk to branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
umbrant committed Jul 7, 2014
2 parents 83702b0 + 4b2ded8 commit dda8563
Show file tree
Hide file tree
Showing 447 changed files with 23,877 additions and 3,223 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ target
hadoop-common-project/hadoop-kms/downloads/
hadoop-hdfs-project/hadoop-hdfs/downloads
hadoop-hdfs-project/hadoop-hdfs-httpfs/downloads
hadoop-common-project/hadoop-common/src/test/resources/contract-test-options.xml
hadoop-tools/hadoop-openstack/src/test/resources/contract-test-options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,15 @@ public void init(FilterConfig filterConfig) throws ServletException {
String authHandlerName = config.getProperty(AUTH_TYPE, null);
String authHandlerClassName;
if (authHandlerName == null) {
throw new ServletException("Authentication type must be specified: simple|kerberos|<class>");
throw new ServletException("Authentication type must be specified: " +
PseudoAuthenticationHandler.TYPE + "|" +
KerberosAuthenticationHandler.TYPE + "|<class>");
}
if (authHandlerName.equals("simple")) {
if (authHandlerName.toLowerCase(Locale.ENGLISH).equals(
PseudoAuthenticationHandler.TYPE)) {
authHandlerClassName = PseudoAuthenticationHandler.class.getName();
} else if (authHandlerName.equals("kerberos")) {
} else if (authHandlerName.toLowerCase(Locale.ENGLISH).equals(
KerberosAuthenticationHandler.TYPE)) {
authHandlerClassName = KerberosAuthenticationHandler.class.getName();
} else {
authHandlerClassName = authHandlerName;
Expand Down Expand Up @@ -421,14 +425,20 @@ public Principal getUserPrincipal() {
* cookie. It has no effect if its value < 0.
*
* XXX the following code duplicate some logic in Jetty / Servlet API,
* because of the fact that Hadoop is stuck at servlet 3.0 and jetty 6
* because of the fact that Hadoop is stuck at servlet 2.5 and jetty 6
* right now.
*/
public static void createAuthCookie(HttpServletResponse resp, String token,
String domain, String path, long expires,
boolean isSecure) {
StringBuilder sb = new StringBuilder(AuthenticatedURL.AUTH_COOKIE).append
("=").append(token);
StringBuilder sb = new StringBuilder(AuthenticatedURL.AUTH_COOKIE)
.append("=");
if (token != null && token.length() > 0) {
sb.append("\"")
.append(token)
.append("\"");
}
sb.append("; Version=1");

if (path != null) {
sb.append("; Path=").append(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void testInitEmpty() throws Exception {
Assert.fail();
} catch (ServletException ex) {
// Expected
Assert.assertEquals("Authentication type must be specified: simple|kerberos|<class>",
ex.getMessage());
} catch (Exception ex) {
Assert.fail();
} finally {
Expand Down Expand Up @@ -233,6 +235,27 @@ public void testInit() throws Exception {
filter.destroy();
}
}

@Test
public void testInitCaseSensitivity() throws Exception {
// minimal configuration & simple auth handler (Pseudo)
AuthenticationFilter filter = new AuthenticationFilter();
try {
FilterConfig config = Mockito.mock(FilterConfig.class);
Mockito.when(config.getInitParameter(AuthenticationFilter.AUTH_TYPE)).thenReturn("SimPle");
Mockito.when(config.getInitParameter(AuthenticationFilter.AUTH_TOKEN_VALIDITY)).thenReturn(
(new Long(TOKEN_VALIDITY_SEC)).toString());
Mockito.when(config.getInitParameterNames()).thenReturn(
new Vector<String>(Arrays.asList(AuthenticationFilter.AUTH_TYPE,
AuthenticationFilter.AUTH_TOKEN_VALIDITY)).elements());

filter.init(config);
Assert.assertEquals(PseudoAuthenticationHandler.class,
filter.getAuthenticationHandler().getClass());
} finally {
filter.destroy();
}
}

@Test
public void testGetRequestURL() throws Exception {
Expand Down Expand Up @@ -508,21 +531,17 @@ public Object answer(InvocationOnMock invocation) throws Throwable {

private static void parseCookieMap(String cookieHeader, HashMap<String,
String> cookieMap) {
for (String pair : cookieHeader.split(";")) {
String p = pair.trim();
int idx = p.indexOf('=');
final String k, v;
if (idx == -1) {
k = p;
v = null;
} else if (idx == p.length()) {
k = p.substring(0, idx - 1);
v = null;
} else {
k = p.substring(0, idx);
v = p.substring(idx + 1);
List<HttpCookie> cookies = HttpCookie.parse(cookieHeader);
for (HttpCookie cookie : cookies) {
if (AuthenticatedURL.AUTH_COOKIE.equals(cookie.getName())) {
cookieMap.put(cookie.getName(), cookie.getValue());
if (cookie.getPath() != null) {
cookieMap.put("Path", cookie.getPath());
}
if (cookie.getDomain() != null) {
cookieMap.put("Domain", cookie.getDomain());
}
}
cookieMap.put(k, v);
}
}

Expand Down
119 changes: 115 additions & 4 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ Trunk (Unreleased)
NEW FEATURES

HADOOP-10433. Key Management Server based on KeyProvider API. (tucu)

HADOOP-9629. Support Windows Azure Storage - Blob as a file system in Hadoop.
(Dexter Bradshaw, Mostafa Elhemali, Xi Fang, Johannes Klein, David Lao,
Mike Liddell, Chuan Liu, Lengning Liu, Ivan Mitic, Michael Rys,
Alexander Stojanovic, Brian Swan, and Min Wei via cnauroth)

HADOOP-10728. Metrics system for Windows Azure Storage Filesystem.
(Dexter Bradshaw, Mostafa Elhemali, Xi Fang, Johannes Klein, David Lao,
Mike Liddell, Chuan Liu, Lengning Liu, Ivan Mitic, Michael Rys,
Alexander Stojanovich, Brian Swan, and Min Wei via cnauroth)

HADOOP-10719. Add generateEncryptedKey and decryptEncryptedKey
methods to KeyProvider. (asuresh via tucu)

IMPROVEMENTS

HADOOP-8017. Configure hadoop-main pom to get rid of M2E plugin execution
Expand Down Expand Up @@ -152,6 +165,18 @@ Trunk (Unreleased)
HADOOP-10607. Create API to separate credential/password storage from
applications. (Larry McCay via omalley)

HADOOP-10696. Add optional attributes to KeyProvider Options and Metadata.
(tucu)

HADOOP-10695. KMSClientProvider should respect a configurable timeout.
(yoderme via tucu)

HADOOP-10757. KeyProvider KeyVersion should provide the key name.
(asuresh via tucu)

HADOOP-10769. Create KeyProvider extension to handle delegation tokens.
(Arun Suresh via atm)

BUG FIXES

HADOOP-9451. Fault single-layer config if node group topology is enabled.
Expand Down Expand Up @@ -339,12 +364,34 @@ Trunk (Unreleased)
HADOOP-10611. KMS, keyVersion name should not be assumed to be
keyName@versionNumber. (tucu)

HADOOP-10717. HttpServer2 should load jsp DTD from local jars instead of
going remote. (Dapeng Sun via wheat9)

HADOOP-10689. InputStream is not closed in
AzureNativeFileSystemStore#retrieve(). (Chen He via cnauroth)

HADOOP-10690. Lack of synchronization on access to InputStream in
NativeAzureFileSystem#NativeAzureFsInputStream#close().
(Chen He via cnauroth)

OPTIMIZATIONS

HADOOP-7761. Improve the performance of raw comparisons. (todd)

HADOOP-8589. ViewFs tests fail when tests and home dirs are nested (sanjay Radia)

Release 2.6.0 - UNRELEASED

INCOMPATIBLE CHANGES

NEW FEATURES

IMPROVEMENTS

OPTIMIZATIONS

BUG FIXES

Release 2.5.0 - UNRELEASED

INCOMPATIBLE CHANGES
Expand All @@ -355,10 +402,7 @@ Release 2.5.0 - UNRELEASED

HADOOP-9704. Write metrics sink plugin for Hadoop/Graphite (Chu Tong, Alex Newman and Babak Behzad via raviprak)

HADOOP-9629. Support Windows Azure Storage - Blob as a file system in Hadoop.
(Dexter Bradshaw, Mostafa Elhemali, Xi Fang, Johannes Klein, David Lao,
Mike Liddell, Chuan Liu, Lengning Liu, Ivan Mitic, Michael Rys,
Alexander Stojanovic, Brian Swan, and Min Wei via cnauroth)
HADOOP-8943. Support multiple group mapping providers. (Kai Zheng via brandonli)

IMPROVEMENTS

Expand Down Expand Up @@ -439,6 +483,48 @@ Release 2.5.0 - UNRELEASED
HADOOP-10557. FsShell -cp -pa option for preserving extended ACLs.
(Akira Ajisaka via cnauroth)

HADOOP-10279. Create multiplexer, a requirement for the fair queue.
(Chris Li via Arpit Agarwal)

HADOOP-10659. Refactor AccessControlList to reuse utility functions
and to improve performance. (Benoy Antony via Arpit Agarwal)

HADOOP-10665. Make Hadoop Authentication Handler loads case in-sensitive
(Benoy Antony via vinayakumarb)

HADOOP-10652. Refactor Proxyusers to use AccessControlList. (Benoy
Antony via Arpit Agarwal)

HADOOP-10747. Support configurable retries on SASL connection failures in
RPC client. (cnauroth)

HADOOP-10674. Improve PureJavaCrc32 performance and use java.util.zip.CRC32
for Java 7 and above. (szetszwo)

HADOOP-10754. Reenable several HA ZooKeeper-related tests on Windows.
(cnauroth)

HADOOP-10565. Support IP ranges (CIDR) in proxyuser.hosts. (Benoy Antony
via Arpit Agarwal)

HADOOP-10649. Allow overriding the default ACL for service authorization
(Benoy Antony via Arpit Agarwal)

HADOOP-10767. Clean up unused code in Ls shell command. (cnauroth)

HADOOP-9361 Strictly define the expected behavior of filesystem APIs and
write tests to verify compliance (stevel)

HADOOP-9651 Filesystems to throw FileAlreadyExistsException in
createFile(path, overwrite=false) when the file exists (stevel)

HADOOP-9495 Define behaviour of Seekable.seek(), write tests,
fix all hadoop implementations for compliance

HADOOP-10312 Shell.ExitCodeException to have more useful toString (stevel)

HADOOP-10782. Fix typo in DataChecksum class. (Jingguo Yao via suresh)

OPTIMIZATIONS

BUG FIXES
Expand Down Expand Up @@ -576,6 +662,23 @@ Release 2.5.0 - UNRELEASED
HADOOP-10716. Cannot use more than 1 har filesystem.
(Rushabh Shah via cnauroth)

HADOOP-9559. When metrics system is restarted MBean names get incorrectly
flagged as dupes. (Mostafa Elhemali and Mike Liddell via cnauroth)

HADOOP-10746. TestSocketIOWithTimeout#testSocketIOWithTimeout fails on
Power PC. (Jinghui Wang via Arpit Agarwal)

HADOOP-9705. FsShell cp -p does not preserve directory attibutes.
(Akira AJISAKA via cnauroth)

HADOOP-10739. Renaming a file into a directory containing the same
filename results in a confusing I/O error (chang li via jlowe)

HADOOP-10533 S3 input stream NPEs in MapReduce join (stevel)

HADOOP-10419 BufferedFSInputStream NPEs on getPos() on a closed stream
(stevel)

BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS

HADOOP-10520. Extended attributes definition and FileSystem APIs for
Expand All @@ -601,6 +704,14 @@ Release 2.5.0 - UNRELEASED

HADOOP-10711. Cleanup some extra dependencies from hadoop-auth. (rkanter via tucu)

HADOOP-10479. Fix new findbugs warnings in hadoop-minikdc.
(Swarnim Kulkarni via wheat9)

HADOOP-10715. Remove public GraphiteSink#setWriter (Babak Behzad via raviprak)

HADOOP-10710. hadoop.auth cookie is not properly constructed according to
RFC2109. (Juan Yu via tucu)

Release 2.4.1 - 2014-06-23

INCOMPATIBLE CHANGES
Expand Down
5 changes: 5 additions & 0 deletions hadoop-common-project/hadoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@
<artifactId>jetty-util</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ <h2>Changes since Hadoop 2.4.0</h2>
Major bug reported by Jian He and fixed by Vinod Kumar Vavilapalli <br>
<b>Few tests in TestJobClient fail on Windows</b><br>
<blockquote></blockquote></li>
<li> <a href="https://issues.apache.org/jira/browse/MAPREDUCE-5830">MAPREDUCE-5830</a>.
Blocker bug reported by Jason Lowe and fixed by Akira AJISAKA <br>
<b>HostUtil.getTaskLogUrl is not backwards binary compatible with 2.3</b><br>
<blockquote></blockquote></li>
<li> <a href="https://issues.apache.org/jira/browse/MAPREDUCE-5828">MAPREDUCE-5828</a>.
Major bug reported by Vinod Kumar Vavilapalli and fixed by Vinod Kumar Vavilapalli <br>
<b>TestMapReduceJobControl fails on JDK 7 + Windows</b><br>
Expand Down Expand Up @@ -506,6 +510,10 @@ <h2>Changes since Hadoop 2.4.0</h2>
Trivial bug reported by Todd Lipcon and fixed by Chen He <br>
<b>docs for map output compression incorrectly reference SequenceFile</b><br>
<blockquote></blockquote></li>
<li> <a href="https://issues.apache.org/jira/browse/HDFS-6527">HDFS-6527</a>.
Blocker bug reported by Kihwal Lee and fixed by Kihwal Lee <br>
<b>Edit log corruption due to defered INode removal</b><br>
<blockquote></blockquote></li>
<li> <a href="https://issues.apache.org/jira/browse/HDFS-6411">HDFS-6411</a>.
Major bug reported by Zhongyi Xie and fixed by Brandon Li (nfs)<br>
<b>nfs-hdfs-gateway mount raises I/O error and hangs when a unauthorized user attempts to access it</b><br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public KeyVersion getKeyVersion(String versionName) throws IOException {
} catch (UnrecoverableKeyException e) {
throw new IOException("Can't recover key " + key + " from " + path, e);
}
return new KeyVersion(versionName, key.getEncoded());
return new KeyVersion(getBaseName(versionName), versionName, key.getEncoded());
} finally {
readLock.unlock();
}
Expand Down Expand Up @@ -270,14 +270,14 @@ public KeyVersion createKey(String name, byte[] material,
e);
}
Metadata meta = new Metadata(options.getCipher(), options.getBitLength(),
options.getDescription(), new Date(), 1);
options.getDescription(), options.getAttributes(), new Date(), 1);
if (options.getBitLength() != 8 * material.length) {
throw new IOException("Wrong key length. Required " +
options.getBitLength() + ", but got " + (8 * material.length));
}
cache.put(name, meta);
String versionName = buildVersionName(name, 0);
return innerSetKeyVersion(versionName, material, meta.getCipher());
return innerSetKeyVersion(name, versionName, material, meta.getCipher());
} finally {
writeLock.unlock();
}
Expand Down Expand Up @@ -316,7 +316,7 @@ public void deleteKey(String name) throws IOException {
}
}

KeyVersion innerSetKeyVersion(String versionName, byte[] material,
KeyVersion innerSetKeyVersion(String name, String versionName, byte[] material,
String cipher) throws IOException {
try {
keyStore.setKeyEntry(versionName, new SecretKeySpec(material, cipher),
Expand All @@ -326,7 +326,7 @@ KeyVersion innerSetKeyVersion(String versionName, byte[] material,
e);
}
changed = true;
return new KeyVersion(versionName, material);
return new KeyVersion(name, versionName, material);
}

@Override
Expand All @@ -344,7 +344,7 @@ public KeyVersion rollNewVersion(String name,
}
int nextVersion = meta.addVersion();
String versionName = buildVersionName(name, nextVersion);
return innerSetKeyVersion(versionName, material, meta.getCipher());
return innerSetKeyVersion(name, versionName, material, meta.getCipher());
} finally {
writeLock.unlock();
}
Expand Down
Loading

0 comments on commit dda8563

Please sign in to comment.