Skip to content

Commit 945a9d9

Browse files
committed
fixes checkstyle errors
1 parent 67f011a commit 945a9d9

File tree

5 files changed

+38
-41
lines changed

5 files changed

+38
-41
lines changed

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

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,41 +30,36 @@
3030
import static org.apache.hadoop.fs.contract.ContractTestUtils.touch;
3131
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
3232

33-
public abstract class AbstractContractContentSummaryTest extends AbstractFSContractTestBase {
33+
public abstract class AbstractContractContentSummaryTest extends AbstractFSContractTestBase {
3434

35-
@Test
36-
public void testGetContentSummary() throws Throwable {
37-
FileSystem fs = getFileSystem();
35+
@Test
36+
public void testGetContentSummary() throws Throwable {
37+
FileSystem fs = getFileSystem();
3838

39-
Path parent = path("parent");
40-
Path nested = path(parent + "/a/b/c");
41-
Path filePath = path(nested + "file.txt");
39+
Path parent = path("parent");
40+
Path nested = path(parent + "/a/b/c");
41+
Path filePath = path(nested + "file.txt");
4242

43-
fs.mkdirs(parent);
44-
fs.mkdirs(nested);
45-
touch(getFileSystem(), filePath);
43+
fs.mkdirs(parent);
44+
fs.mkdirs(nested);
45+
touch(getFileSystem(), filePath);
4646

47-
ContentSummary summary = fs.getContentSummary(parent);
47+
ContentSummary summary = fs.getContentSummary(parent);
4848

49-
Assertions.assertThat(summary.getDirectoryCount())
50-
.as("Summary " + summary)
51-
.isEqualTo(4);
49+
Assertions.assertThat(summary.getDirectoryCount()).as("Summary " + summary).isEqualTo(4);
5250

53-
Assertions.assertThat(summary.getFileCount())
54-
.as("Summary " + summary)
55-
.isEqualTo(1);
56-
}
51+
Assertions.assertThat(summary.getFileCount()).as("Summary " + summary).isEqualTo(1);
52+
}
5753

58-
@Test
59-
public void testGetContentSummaryIncorrectPath() throws Throwable {
60-
FileSystem fs = getFileSystem();
54+
@Test
55+
public void testGetContentSummaryIncorrectPath() throws Throwable {
56+
FileSystem fs = getFileSystem();
6157

62-
Path parent = path("parent");
63-
Path nested = path(parent + "/a");
58+
Path parent = path("parent");
59+
Path nested = path(parent + "/a");
6460

65-
fs.mkdirs(parent);
61+
fs.mkdirs(parent);
6662

67-
intercept(FileNotFoundException.class,
68-
() -> fs.getContentSummary(nested));
69-
}
63+
intercept(FileNotFoundException.class, () -> fs.getContentSummary(nested));
64+
}
7065
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
public class TestLocalFSContractContentSummary extends AbstractContractContentSummaryTest {
2626

27-
@Override
28-
protected AbstractFSContract createContract(Configuration conf) {
29-
return new LocalFSContract(conf);
30-
}
27+
@Override
28+
protected AbstractFSContract createContract(Configuration conf) {
29+
return new LocalFSContract(conf);
30+
}
3131
}

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,8 +3284,8 @@ public S3AFileStatus probePathStatus(final Path path,
32843284
}
32853285

32863286
@Override
3287-
public RemoteIterator<S3ALocatedFileStatus> listFilesIterator(final Path path, final boolean recursive)
3288-
throws IOException {
3287+
public RemoteIterator<S3ALocatedFileStatus> listFilesIterator(final Path path,
3288+
final boolean recursive) throws IOException {
32893289
return S3AFileSystem.this.innerListFiles(path, recursive, Listing.ACCEPT_ALL_BUT_S3N, null);
32903290
}
32913291
}

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ObjectAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public S3ObjectAttributes(
6666
/**
6767
* Construct from the result of a copy and those parameters
6868
* which aren't included in an AWS SDK response.
69-
* @param path
69+
* @param path path
7070
* @param copyResult copy result.
7171
* @param serverSideEncryptionAlgorithm current encryption algorithm
7272
* @param serverSideEncryptionKey any server side encryption key?

hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/GetContentSummaryOperation.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,21 @@ public ContentSummary getDirSummary(Path dir) throws IOException {
167167
}
168168

169169
/***
170-
* This method builds the set of all directories found under the base path. We need to do this because if the
171-
* directory structure /a/b/c was created with a single mkdirs() call, it is stored as 1 object in S3 and the list
172-
* files iterator will only return a single entry /a/b/c.
170+
* This method builds the set of all directories found under the base path. We need to do this
171+
* because if the directory structure /a/b/c was created with a single mkdirs() call, it is
172+
* stored as 1 object in S3 and the list files iterator will only return a single entry /a/b/c.
173173
*
174-
* We keep track of paths traversed so far to prevent duplication of work. For eg, if we had a/b/c/file-1.txt and
175-
* /a/b/c/file-2.txt, we will only recurse over the complete path once and won't have to do anything for file-2.txt.
174+
* We keep track of paths traversed so far to prevent duplication of work. For eg, if we had
175+
* a/b/c/file-1.txt and /a/b/c/file-2.txt, we will only recurse over the complete path once
176+
* and won't have to do anything for file-2.txt.
176177
*
177178
* @param dirSet Set of all directories found in the path
178179
* @param pathsTraversed Set of all paths traversed so far
179180
* @param basePath Path of directory to scan
180181
* @param parentPath Parent path of the current file/directory in the iterator
181182
*/
182-
private void buildDirectorySet(Set<Path> dirSet, Set<Path> pathsTraversed, Path basePath, Path parentPath) {
183+
private void buildDirectorySet(Set<Path> dirSet, Set<Path> pathsTraversed, Path basePath,
184+
Path parentPath) {
183185

184186
if (parentPath == null || pathsTraversed.contains(parentPath) || parentPath.equals(basePath)) {
185187
return;
@@ -225,7 +227,7 @@ public interface GetContentSummaryCallbacks {
225227
S3AFileStatus probePathStatus(Path path, Set<StatusProbeEnum> probes) throws IOException;
226228

227229
/***
228-
* List all entries under a path
230+
* List all entries under a path.
229231
*
230232
* @param path
231233
* @param recursive if the subdirectories need to be traversed recursively

0 commit comments

Comments
 (0)