Skip to content

Commit 10d6210

Browse files
committed
Merge r1609845 through r1614231 from trunk.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-6584@1614234 13f79535-47bb-0310-9956-ffa450edef68
2 parents 48dc486 + c6cddce commit 10d6210

File tree

153 files changed

+4720
-607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+4720
-607
lines changed

hadoop-common-project/hadoop-common/CHANGES.txt

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ Trunk (Unreleased)
189189
HADOOP-10720. KMS: Implement generateEncryptedKey and decryptEncryptedKey
190190
in the REST API. (asuresh via tucu)
191191

192+
HADOOP-10891. Add EncryptedKeyVersion factory method to
193+
KeyProviderCryptoExtension. (wang)
194+
192195
BUG FIXES
193196

194197
HADOOP-9451. Fault single-layer config if node group topology is enabled.
@@ -452,6 +455,11 @@ Release 2.6.0 - UNRELEASED
452455

453456
HADOOP-10855. Allow Text to be read with a known Length. (todd)
454457

458+
HADOOP-10887. Add XAttrs to ViewFs and make XAttrs + ViewFileSystem
459+
internal dir behavior consistent. (Stephen Chu via wang)
460+
461+
HADOOP-10882. Move DirectBufferPool into common util. (todd)
462+
455463
OPTIMIZATIONS
456464

457465
BUG FIXES
@@ -480,6 +488,12 @@ Release 2.6.0 - UNRELEASED
480488
command when the format of the stat command uses non-curly quotes (yzhang
481489
via cmccabe)
482490

491+
HADOOP-10830. Missing lock in JavaKeyStoreProvider.createCredentialEntry.
492+
(Benoy Antony via umamahesh)
493+
494+
HADOOP-10876. The constructor of Path should not take an empty URL as a
495+
parameter. (Zhihai Xu via wang)
496+
483497
Release 2.5.0 - UNRELEASED
484498

485499
INCOMPATIBLE CHANGES
@@ -492,6 +506,9 @@ Release 2.5.0 - UNRELEASED
492506

493507
HADOOP-8943. Support multiple group mapping providers. (Kai Zheng via brandonli)
494508

509+
HADOOP-9361 Strictly define the expected behavior of filesystem APIs and
510+
write tests to verify compliance (stevel)
511+
495512
IMPROVEMENTS
496513

497514
HADOOP-10451. Remove unused field and imports from SaslRpcServer.
@@ -586,9 +603,6 @@ Release 2.5.0 - UNRELEASED
586603
HADOOP-10747. Support configurable retries on SASL connection failures in
587604
RPC client. (cnauroth)
588605

589-
HADOOP-10674. Improve PureJavaCrc32 performance and use java.util.zip.CRC32
590-
for Java 7 and above. (szetszwo)
591-
592606
HADOOP-10754. Reenable several HA ZooKeeper-related tests on Windows.
593607
(cnauroth)
594608

@@ -600,9 +614,6 @@ Release 2.5.0 - UNRELEASED
600614

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

603-
HADOOP-9361 Strictly define the expected behavior of filesystem APIs and
604-
write tests to verify compliance (stevel)
605-
606617
HADOOP-9651 Filesystems to throw FileAlreadyExistsException in
607618
createFile(path, overwrite=false) when the file exists (stevel)
608619

@@ -613,8 +624,14 @@ Release 2.5.0 - UNRELEASED
613624

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

627+
HADOOP-10896. Update compatibility doc to capture visibility of
628+
un-annotated classes/ methods. (kasha)
629+
616630
OPTIMIZATIONS
617631

632+
HADOOP-10674. Improve PureJavaCrc32 performance and use java.util.zip.CRC32
633+
for Java 7 and above. (szetszwo)
634+
618635
BUG FIXES
619636

620637
HADOOP-10378. Typo in help printed by hdfs dfs -help.
@@ -769,6 +786,30 @@ Release 2.5.0 - UNRELEASED
769786

770787
HADOOP-10801 dead link in site.xml (Akira AJISAKA via stevel)
771788

789+
HADOOP-10590. ServiceAuthorizationManager is not threadsafe. (Benoy Antony via vinayakumarb)
790+
791+
HADOOP-10711. Cleanup some extra dependencies from hadoop-auth. (rkanter via tucu)
792+
793+
HADOOP-10479. Fix new findbugs warnings in hadoop-minikdc.
794+
(Swarnim Kulkarni via wheat9)
795+
796+
HADOOP-10715. Remove public GraphiteSink#setWriter (Babak Behzad via raviprak)
797+
798+
HADOOP-10710. hadoop.auth cookie is not properly constructed according to
799+
RFC2109. (Juan Yu via tucu)
800+
801+
HADOOP-10864. Tool documentenation is broken. (Akira Ajisaka
802+
via Arpit Agarwal)
803+
804+
HADOOP-10872. TestPathData fails intermittently with "Mkdirs failed
805+
to create d1". (Yongjun Zhang via Arpit Agarwal)
806+
807+
HADOOP-10890. TestDFVariations.testMount fails intermittently. (Yongjun
808+
Zhang via Arpit Agarwal)
809+
810+
HADOOP-10894. Fix dead link in ToolRunner documentation. (Akira Ajisaka
811+
via Arpit Agarwal)
812+
772813
BREAKDOWN OF HADOOP-10514 SUBTASKS AND RELATED JIRAS
773814

774815
HADOOP-10520. Extended attributes definition and FileSystem APIs for
@@ -790,21 +831,6 @@ Release 2.5.0 - UNRELEASED
790831
HADOOP-10561. Copy command with preserve option should handle Xattrs.
791832
(Yi Liu via cnauroth)
792833

793-
HADOOP-10590. ServiceAuthorizationManager is not threadsafe. (Benoy Antony via vinayakumarb)
794-
795-
HADOOP-10711. Cleanup some extra dependencies from hadoop-auth. (rkanter via tucu)
796-
797-
HADOOP-10479. Fix new findbugs warnings in hadoop-minikdc.
798-
(Swarnim Kulkarni via wheat9)
799-
800-
HADOOP-10715. Remove public GraphiteSink#setWriter (Babak Behzad via raviprak)
801-
802-
HADOOP-10710. hadoop.auth cookie is not properly constructed according to
803-
RFC2109. (Juan Yu via tucu)
804-
805-
HADOOP-10864. Tool documentenation is broken. (Akira Ajisaka
806-
via Arpit Agarwal)
807-
808834
Release 2.4.1 - 2014-06-23
809835

810836
INCOMPATIBLE CHANGES

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/KeyProviderCryptoExtension.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,30 @@ protected EncryptedKeyVersion(String keyName,
7979
this.encryptedKeyVersion = encryptedKeyVersion;
8080
}
8181

82+
/**
83+
* Factory method to create a new EncryptedKeyVersion that can then be
84+
* passed into {@link #decryptEncryptedKey}. Note that the fields of the
85+
* returned EncryptedKeyVersion will only partially be populated; it is not
86+
* necessarily suitable for operations besides decryption.
87+
*
88+
* @param encryptionKeyVersionName Version name of the encryption key used
89+
* to encrypt the encrypted key.
90+
* @param encryptedKeyIv Initialization vector of the encrypted
91+
* key. The IV of the encryption key used to
92+
* encrypt the encrypted key is derived from
93+
* this IV.
94+
* @param encryptedKeyMaterial Key material of the encrypted key.
95+
* @return EncryptedKeyVersion suitable for decryption.
96+
*/
97+
public static EncryptedKeyVersion createForDecryption(String
98+
encryptionKeyVersionName, byte[] encryptedKeyIv,
99+
byte[] encryptedKeyMaterial) {
100+
KeyVersion encryptedKeyVersion = new KeyVersion(null, null,
101+
encryptedKeyMaterial);
102+
return new EncryptedKeyVersion(null, encryptionKeyVersionName,
103+
encryptedKeyIv, encryptedKeyVersion);
104+
}
105+
82106
/**
83107
* @return Name of the encryption key used to encrypt the encrypted key.
84108
*/

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,9 @@ private FSDataOutputStream create(Path f, FsPermission permission,
437437
throw new FileNotFoundException("Parent directory doesn't exist: "
438438
+ parent);
439439
} else if (!mkdirs(parent)) {
440-
throw new IOException("Mkdirs failed to create " + parent);
440+
throw new IOException("Mkdirs failed to create " + parent
441+
+ " (exists=" + exists(parent) + ", cwd=" + getWorkingDirectory()
442+
+ ")");
441443
}
442444
}
443445
final FSDataOutputStream out;

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileContext.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,4 +2484,33 @@ public Void next(final AbstractFileSystem fs, final Path p)
24842484
}
24852485
}.resolve(this, absF);
24862486
}
2487+
2488+
/**
2489+
* Get all of the xattr names for a file or directory.
2490+
* Only those xattr names which the logged-in user has permissions to view
2491+
* are returned.
2492+
* <p/>
2493+
* A regular user can only get xattr names for the "user" namespace.
2494+
* The super user can only get xattr names for "user" and "trusted"
2495+
* namespaces.
2496+
* The xattrs of the "security" and "system" namespaces are only
2497+
* used/exposed internally by/to the FS impl.
2498+
* <p/>
2499+
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
2500+
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
2501+
*
2502+
* @param path Path to get extended attributes
2503+
* @return List<String> of the XAttr names of the file or directory
2504+
* @throws IOException
2505+
*/
2506+
public List<String> listXAttrs(Path path) throws IOException {
2507+
final Path absF = fixRelativePart(path);
2508+
return new FSLinkResolver<List<String>>() {
2509+
@Override
2510+
public List<String> next(final AbstractFileSystem fs, final Path p)
2511+
throws IOException {
2512+
return fs.listXAttrs(p);
2513+
}
2514+
}.resolve(this, absF);
2515+
}
24872516
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@ public Map<String, byte[]> getXAttrs(Path path, List<String> names)
25092509
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
25102510
*
25112511
* @param path Path to get extended attributes
2512-
* @return Map<String, byte[]> describing the XAttrs of the file or directory
2512+
* @return List<String> of the XAttr names of the file or directory
25132513
* @throws IOException
25142514
*/
25152515
public List<String> listXAttrs(Path path) throws IOException {

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,20 @@ private void checkPathArg( String path ) throws IllegalArgumentException {
128128
"Can not create a Path from an empty string");
129129
}
130130
}
131-
131+
132+
/** check URI parameter of Path constructor. */
133+
private void checkPathArg(URI aUri) throws IllegalArgumentException {
134+
// disallow construction of a Path from an empty URI
135+
if (aUri == null) {
136+
throw new IllegalArgumentException(
137+
"Can not create a Path from a null URI");
138+
}
139+
if (aUri.toString().isEmpty()) {
140+
throw new IllegalArgumentException(
141+
"Can not create a Path from an empty URI");
142+
}
143+
}
144+
132145
/** Construct a path from a String. Path strings are URIs, but with
133146
* unescaped elements and some additional normalization. */
134147
public Path(String pathString) throws IllegalArgumentException {
@@ -176,6 +189,7 @@ public Path(String pathString) throws IllegalArgumentException {
176189
* Construct a path from a URI
177190
*/
178191
public Path(URI aUri) {
192+
checkPathArg(aUri);
179193
uri = aUri.normalize();
180194
}
181195

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFs.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.net.URISyntaxException;
2323
import java.util.EnumSet;
2424
import java.util.List;
25+
import java.util.Map;
2526

2627
import org.apache.hadoop.classification.InterfaceAudience;
2728
import org.apache.hadoop.classification.InterfaceStability;
@@ -37,6 +38,7 @@
3738
import org.apache.hadoop.fs.Options.ChecksumOpt;
3839
import org.apache.hadoop.fs.Path;
3940
import org.apache.hadoop.fs.UnresolvedLinkException;
41+
import org.apache.hadoop.fs.XAttrSetFlag;
4042
import org.apache.hadoop.fs.permission.AclEntry;
4143
import org.apache.hadoop.fs.permission.AclStatus;
4244
import org.apache.hadoop.fs.permission.FsPermission;
@@ -313,6 +315,38 @@ public AclStatus getAclStatus(Path path) throws IOException {
313315
return myFs.getAclStatus(fullPath(path));
314316
}
315317

318+
@Override
319+
public void setXAttr(Path path, String name, byte[] value,
320+
EnumSet<XAttrSetFlag> flag) throws IOException {
321+
myFs.setXAttr(fullPath(path), name, value, flag);
322+
}
323+
324+
@Override
325+
public byte[] getXAttr(Path path, String name) throws IOException {
326+
return myFs.getXAttr(fullPath(path), name);
327+
}
328+
329+
@Override
330+
public Map<String, byte[]> getXAttrs(Path path) throws IOException {
331+
return myFs.getXAttrs(fullPath(path));
332+
}
333+
334+
@Override
335+
public Map<String, byte[]> getXAttrs(Path path, List<String> names)
336+
throws IOException {
337+
return myFs.getXAttrs(fullPath(path), names);
338+
}
339+
340+
@Override
341+
public List<String> listXAttrs(Path path) throws IOException {
342+
return myFs.listXAttrs(fullPath(path));
343+
}
344+
345+
@Override
346+
public void removeXAttr(Path path, String name) throws IOException {
347+
myFs.removeXAttr(fullPath(path), name);
348+
}
349+
316350
@Override
317351
public void setVerifyChecksum(final boolean verifyChecksum)
318352
throws IOException, UnresolvedLinkException {

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,5 +913,39 @@ public AclStatus getAclStatus(Path path) throws IOException {
913913
.addEntries(AclUtil.getMinimalAcl(PERMISSION_555))
914914
.stickyBit(false).build();
915915
}
916+
917+
@Override
918+
public void setXAttr(Path path, String name, byte[] value,
919+
EnumSet<XAttrSetFlag> flag) throws IOException {
920+
checkPathIsSlash(path);
921+
throw readOnlyMountTable("setXAttr", path);
922+
}
923+
924+
@Override
925+
public byte[] getXAttr(Path path, String name) throws IOException {
926+
throw new NotInMountpointException(path, "getXAttr");
927+
}
928+
929+
@Override
930+
public Map<String, byte[]> getXAttrs(Path path) throws IOException {
931+
throw new NotInMountpointException(path, "getXAttrs");
932+
}
933+
934+
@Override
935+
public Map<String, byte[]> getXAttrs(Path path, List<String> names)
936+
throws IOException {
937+
throw new NotInMountpointException(path, "getXAttrs");
938+
}
939+
940+
@Override
941+
public List<String> listXAttrs(Path path) throws IOException {
942+
throw new NotInMountpointException(path, "listXAttrs");
943+
}
944+
945+
@Override
946+
public void removeXAttr(Path path, String name) throws IOException {
947+
checkPathIsSlash(path);
948+
throw readOnlyMountTable("removeXAttr", path);
949+
}
916950
}
917951
}

0 commit comments

Comments
 (0)