Skip to content

Commit d9224c7

Browse files
author
Tom McCormick
committed
fix checkstyles
1 parent 9c208a9 commit d9224c7

File tree

6 files changed

+47
-37
lines changed

6 files changed

+47
-37
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ public MultipartUploaderBuilder createMultipartUploader(Path basePath)
16431643
* The enclosing root path is a common ancestor that should be used for temp and staging dirs
16441644
* as well as within encryption zones and other restricted directories.
16451645
*
1646-
* Call makeQualified on the param path to ensure the param path to ensure its part of the correct filesystem
1646+
* Call makeQualified on the param path to ensure its part of the correct filesystem
16471647
*
16481648
* @param path file path to find the enclosing root path for
16491649
* @return a path to the enclosing root

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
@@ -4949,7 +4949,7 @@ public CompletableFuture<FSDataInputStream> build() throws IOException {
49494949
* The enclosing root path is a common ancestor that should be used for temp and staging dirs
49504950
* as well as within encryption zones and other restricted directories.
49514951
*
4952-
* Call makeQualified on the param path to ensure the param path to ensure its part of the correct filesystem.
4952+
* Call makeQualified on the param path to ensure its part of the correct filesystem.
49534953
*
49544954
* @param path file path to find the enclosing root path for
49554955
* @return a path to the enclosing root

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,8 @@ public Path getEnclosingRoot(Path path) throws IOException {
19401940
try {
19411941
res = fsState.resolve((path.toString()), true);
19421942
} catch (FileNotFoundException ex) {
1943-
throw new NotInMountpointException(path, String.format("getEnclosingRoot - %s", ex.getMessage()));
1943+
throw new NotInMountpointException(path,
1944+
String.format("getEnclosingRoot - %s", ex.getMessage()));
19441945
}
19451946
Path fullPath = new Path(res.resolvedPath);
19461947
Path enclosingPath = res.targetFileSystem.getEnclosingRoot(path);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,8 @@ public Path getEnclosingRoot(Path path) throws IOException {
14841484
try {
14851485
res = fsState.resolve((path.toString()), true);
14861486
} catch (FileNotFoundException ex) {
1487-
throw new NotInMountpointException(path, String.format("getEnclosingRoot - %s", ex.getMessage()));
1487+
throw new NotInMountpointException(path,
1488+
String.format("getEnclosingRoot - %s", ex.getMessage()));
14881489
}
14891490
Path fullPath = new Path(res.resolvedPath);
14901491
Path enclosingPath = res.targetFileSystem.getEnclosingRoot(path);

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractGetEnclosingRoot.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ public void testEnclosingRootEquivalence() throws IOException {
4040
root, fs.getEnclosingRoot(foobar));
4141
assertEquals("Ensure getEnclosingRoot called on itself returns the root directory",
4242
root, fs.getEnclosingRoot(fs.getEnclosingRoot(foobar)));
43-
assertEquals("Ensure getEnclosingRoot for different paths in the same enclosing root returns the same path",
43+
assertEquals(
44+
"Ensure getEnclosingRoot for different paths in the same enclosing root returns the same path",
4445
fs.getEnclosingRoot(root), fs.getEnclosingRoot(foobar));
4546
assertEquals("Ensure getEnclosingRoot on a path returns the root directory",
4647
root, fs.getEnclosingRoot(methodPath()));
4748
assertEquals("Ensure getEnclosingRoot called on itself on a path returns the root directory",
4849
root, fs.getEnclosingRoot(fs.getEnclosingRoot(methodPath())));
49-
assertEquals("Ensure getEnclosingRoot for different paths in the same enclosing root returns the same path", fs.getEnclosingRoot(root), fs.getEnclosingRoot(methodPath()));
50+
assertEquals(
51+
"Ensure getEnclosingRoot for different paths in the same enclosing root "
52+
+ "returns the same path",
53+
fs.getEnclosingRoot(root),
54+
fs.getEnclosingRoot(methodPath()));
5055
}
5156

5257

@@ -57,7 +62,8 @@ public void testEnclosingRootPathExists() throws Exception {
5762
Path foobar = methodPath();
5863
fs.mkdirs(foobar);
5964

60-
assertEquals("Ensure getEnclosingRoot returns the root directory when the root directory exists",
65+
assertEquals(
66+
"Ensure getEnclosingRoot returns the root directory when the root directory exists",
6167
root, fs.getEnclosingRoot(foobar));
6268
assertEquals("Ensure getEnclosingRoot returns the root directory when the directory exists",
6369
root, fs.getEnclosingRoot(foobar));
@@ -70,9 +76,11 @@ public void testEnclosingRootPathDNE() throws Exception {
7076
Path root = path("/");
7177

7278
// .
73-
assertEquals("Ensure getEnclosingRoot returns the root directory even when the path does not exist",
79+
assertEquals(
80+
"Ensure getEnclosingRoot returns the root directory even when the path does not exist",
7481
root, fs.getEnclosingRoot(foobar));
75-
assertEquals("Ensure getEnclosingRoot returns the root directory even when the path does not exist",
82+
assertEquals(
83+
"Ensure getEnclosingRoot returns the root directory even when the path does not exist",
7684
root, fs.getEnclosingRoot(methodPath()));
7785
}
7886

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemHdfs.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -193,34 +193,34 @@ Path getTrashRootInFallBackFS() throws IOException {
193193
@Test
194194
public void testTrashRootsAfterEncryptionZoneDeletion() throws Exception {
195195
try {
196-
final Path zone = new Path("/EZ");
197-
fsTarget.mkdirs(zone);
198-
final Path zone1 = new Path("/EZ/zone1");
199-
fsTarget.mkdirs(zone1);
200-
201-
DFSTestUtil.createKey("test_key", cluster, CONF);
202-
HdfsAdmin hdfsAdmin = new HdfsAdmin(cluster.getURI(0), CONF);
203-
final EnumSet<CreateEncryptionZoneFlag> provisionTrash =
204-
EnumSet.of(CreateEncryptionZoneFlag.PROVISION_TRASH);
205-
hdfsAdmin.createEncryptionZone(zone1, "test_key", provisionTrash);
206-
207-
final Path encFile = new Path(zone1, "encFile");
208-
DFSTestUtil.createFile(fsTarget, encFile, 10240, (short) 1, 0xFEED);
209-
210-
Configuration clientConf = new Configuration(CONF);
211-
clientConf.setLong(FS_TRASH_INTERVAL_KEY, 1);
212-
clientConf.set("fs.default.name", fsTarget.getUri().toString());
213-
FsShell shell = new FsShell(clientConf);
214-
215-
//Verify file deletion within EZ
216-
DFSTestUtil.verifyDelete(shell, fsTarget, encFile, true);
217-
assertTrue("ViewFileSystem trash roots should include EZ file trash",
218-
(fsView.getTrashRoots(true).size() == 1));
219-
220-
//Verify deletion of EZ
221-
DFSTestUtil.verifyDelete(shell, fsTarget, zone, true);
222-
assertTrue("ViewFileSystem trash roots should include EZ zone trash",
223-
(fsView.getTrashRoots(true).size() == 2));
196+
final Path zone = new Path("/EZ");
197+
fsTarget.mkdirs(zone);
198+
final Path zone1 = new Path("/EZ/zone1");
199+
fsTarget.mkdirs(zone1);
200+
201+
DFSTestUtil.createKey("test_key", cluster, CONF);
202+
HdfsAdmin hdfsAdmin = new HdfsAdmin(cluster.getURI(0), CONF);
203+
final EnumSet<CreateEncryptionZoneFlag> provisionTrash =
204+
EnumSet.of(CreateEncryptionZoneFlag.PROVISION_TRASH);
205+
hdfsAdmin.createEncryptionZone(zone1, "test_key", provisionTrash);
206+
207+
final Path encFile = new Path(zone1, "encFile");
208+
DFSTestUtil.createFile(fsTarget, encFile, 10240, (short) 1, 0xFEED);
209+
210+
Configuration clientConf = new Configuration(CONF);
211+
clientConf.setLong(FS_TRASH_INTERVAL_KEY, 1);
212+
clientConf.set("fs.default.name", fsTarget.getUri().toString());
213+
FsShell shell = new FsShell(clientConf);
214+
215+
//Verify file deletion within EZ
216+
DFSTestUtil.verifyDelete(shell, fsTarget, encFile, true);
217+
assertTrue("ViewFileSystem trash roots should include EZ file trash",
218+
(fsView.getTrashRoots(true).size() == 1));
219+
220+
//Verify deletion of EZ
221+
DFSTestUtil.verifyDelete(shell, fsTarget, zone, true);
222+
assertTrue("ViewFileSystem trash roots should include EZ zone trash",
223+
(fsView.getTrashRoots(true).size() == 2));
224224
} finally {
225225
DFSTestUtil.deleteKey("test_key", cluster);
226226
}

0 commit comments

Comments
 (0)