Skip to content

Commit 53f18d6

Browse files
author
fanshilun
committed
HADOOP-19431. Fix CheckStyle.
1 parent 023b1c9 commit 53f18d6

File tree

8 files changed

+48
-47
lines changed

8 files changed

+48
-47
lines changed

hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/SimpleCopyListing.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ protected SimpleCopyListing(Configuration configuration,
119119
this.randomizeFileListing = randomizeFileListing;
120120
}
121121

122-
protected void initSimpleCopyListing(Configuration configuration,
123-
Credentials credentials, int numListstatusThreads, int fileStatusLimit,
124-
boolean randomizeFileListing) {
125-
setConf(configuration);
126-
setCredentials(credentials);
127-
this.numListstatusThreads = numListstatusThreads;
128-
this.fileStatusLimit = Math.max(1, fileStatusLimit);
129-
this.randomizeFileListing = randomizeFileListing;
122+
protected void initSimpleCopyListing(Configuration pConfiguration,
123+
Credentials pCredentials, int pNumListstatusThreads, int pFileStatusLimit,
124+
boolean pRandomizeFileListing) {
125+
setConf(pConfiguration);
126+
setCredentials(pCredentials);
127+
this.numListstatusThreads = pNumListstatusThreads;
128+
this.fileStatusLimit = Math.max(1, pFileStatusLimit);
129+
this.randomizeFileListing = pRandomizeFileListing;
130130
}
131131

132132
protected SimpleCopyListing(Configuration configuration,

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestCopyListing.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ private void validateFinalListing(Path pathToListFile, List<Path> srcFiles)
409409
int idx = 0;
410410
while (reader.next(currentKey)) {
411411
reader.getCurrentValue(currentVal);
412-
assertEquals(fs.makeQualified(srcFiles.get(idx))
413-
, currentVal.getPath(), "srcFiles.size=" + srcFiles.size()
414-
+ ", idx=" + idx);
412+
assertEquals(fs.makeQualified(srcFiles.get(idx)),
413+
currentVal.getPath(), "srcFiles.size=" + srcFiles.size() +
414+
", idx=" + idx);
415415
if (LOG.isDebugEnabled()) {
416416
LOG.debug("val=" + fs.makeQualified(srcFiles.get(idx)));
417417
}

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestDistCpOptions.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ public void testSetNonPositiveBandwidth() {
121121

122122
@Test
123123
public void testSetZeroBandwidth() {
124-
assertThrows(IllegalArgumentException.class, ()->{
124+
assertThrows(IllegalArgumentException.class, () -> {
125125
new DistCpOptions.Builder(
126-
Collections.singletonList(new Path("hdfs://localhost:8020/source")),
127-
new Path("hdfs://localhost:8020/target/"))
128-
.withMapBandwidth(0)
129-
.build();
126+
Collections.singletonList(new Path("hdfs://localhost:8020/source")),
127+
new Path("hdfs://localhost:8020/target/"))
128+
.withMapBandwidth(0)
129+
.build();
130130
});
131131
}
132132

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestDistCpSystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ private void compareFiles(FileSystem fs, FileStatus srcStat,
216216
"File POSIX permission should match");
217217
assertEquals(srcStat.getOwner(), dstStat.getOwner(),
218218
"File user ownership should match");
219-
assertEquals(
220-
srcStat.getGroup(), dstStat.getGroup(), "File group ownership should match");
219+
assertEquals(srcStat.getGroup(), dstStat.getGroup(),
220+
"File group ownership should match");
221221
// TODO; check ACL attributes
222222

223223
if (srcStat.isDirectory()) {

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestExternalCall.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,20 @@ public void tearDown() {
8888
@Test
8989
public void testCleanup() throws Exception {
9090

91-
Configuration conf = getConf();
91+
Configuration conf = getConf();
9292

93-
Path stagingDir = JobSubmissionFiles.getStagingDir(new Cluster(conf),
94-
conf);
95-
stagingDir.getFileSystem(conf).mkdirs(stagingDir);
96-
Path soure = createFile("tmp.txt");
97-
Path target = createFile("target.txt");
93+
Path stagingDir = JobSubmissionFiles.getStagingDir(new Cluster(conf),
94+
conf);
95+
stagingDir.getFileSystem(conf).mkdirs(stagingDir);
96+
Path soure = createFile("tmp.txt");
97+
Path target = createFile("target.txt");
9898

99-
DistCp distcp = new DistCp(conf, null);
100-
String[] arg = { soure.toString(), target.toString() };
99+
DistCp distcp = new DistCp(conf, null);
100+
String[] arg = { soure.toString(), target.toString() };
101101

102-
distcp.run(arg);
103-
assertTrue(fs.exists(target));
102+
distcp.run(arg);
103+
assertTrue(fs.exists(target));
104104

105-
106105
}
107106

108107
private Path createFile(String fname) throws IOException {

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyMapper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ private void doTestIgnoreFailures(boolean ignoreFailures) {
944944
}
945945
if (ignoreFailures) {
946946
for (Text value : stubContext.getWriter().values()) {
947-
assertTrue(
948-
value.toString().startsWith("FAIL:"), value.toString() + " is not skipped");
947+
assertTrue(value.toString().startsWith("FAIL:"),
948+
value.toString() + " is not skipped");
949949
}
950950
}
951951
assertTrue(ignoreFailures, "There should have been an exception.");
@@ -1332,11 +1332,11 @@ private void testPreserveUserGroupImpl(boolean preserve){
13321332
assertTrue(!preserve || source.getOwner().equals(target.getOwner()));
13331333
assertTrue(!preserve || source.getGroup().equals(target.getGroup()));
13341334
assertTrue(!preserve || source.getPermission().equals(target.getPermission()));
1335-
assertTrue( preserve || !source.getOwner().equals(target.getOwner()));
1336-
assertTrue( preserve || !source.getGroup().equals(target.getGroup()));
1337-
assertTrue( preserve || !source.getPermission().equals(target.getPermission()));
1335+
assertTrue(preserve || !source.getOwner().equals(target.getOwner()));
1336+
assertTrue(preserve || !source.getGroup().equals(target.getGroup()));
1337+
assertTrue(preserve || !source.getPermission().equals(target.getPermission()));
13381338
assertTrue(source.isDirectory() ||
1339-
source.getReplication() != target.getReplication());
1339+
source.getReplication() != target.getReplication());
13401340
}
13411341
}
13421342
}

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestDeletedDirTracker.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ private void expectShouldDelete(final Path path, boolean isDir) {
206206
}
207207

208208
private void expectShouldDelete(CopyListingFileStatus status) {
209-
assertTrue(
210-
shouldDelete(status), "Expected shouldDelete of " + status.getPath());
209+
assertTrue(shouldDelete(status),
210+
"Expected shouldDelete of " + status.getPath());
211211
}
212212

213213
private boolean shouldDelete(final Path path, final boolean isDir) {
@@ -223,9 +223,8 @@ private void expectShouldNotDelete(final Path path, boolean isDir) {
223223
}
224224

225225
private void expectShouldNotDelete(CopyListingFileStatus status) {
226-
assertFalse(
227-
shouldDelete(status), "Expected !shouldDelete of " + status.getPath()
228-
+ " but got true");
226+
assertFalse(shouldDelete(status),
227+
"Expected !shouldDelete of " + status.getPath() + " but got true");
229228
}
230229

231230
private CopyListingFileStatus newStatus(final Path path,
@@ -242,13 +241,13 @@ private CopyListingFileStatus fileStatus(final Path path) {
242241
}
243242

244243
private void expectCached(final Path path) {
245-
assertTrue(
246-
tracker.isContained(path), "Path " + path + " is not in the cache of " + tracker);
244+
assertTrue(tracker.isContained(path),
245+
"Path " + path + " is not in the cache of " + tracker);
247246
}
248247

249248
private void expectNotCached(final Path path) {
250-
assertFalse(
251-
tracker.isContained(path), "Path " + path + " is in the cache of " + tracker);
249+
assertFalse(tracker.isContained(path),
250+
"Path " + path + " is in the cache of " + tracker);
252251
}
253252

254253
}

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/lib/TestDynamicInputFormat.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,14 @@ public void testDynamicInputChunkContext() throws IOException {
203203
secondInputFormat.getChunkContext(configuration);
204204
DynamicInputChunkContext fourthContext =
205205
secondInputFormat.getChunkContext(configuration);
206-
assertTrue(firstContext.equals(secondContext), "Chunk contexts from the same DynamicInputFormat " +
206+
assertTrue(firstContext.equals(secondContext),
207+
"Chunk contexts from the same DynamicInputFormat " +
207208
"object should be the same.");
208-
assertTrue(thirdContext.equals(fourthContext), "Chunk contexts from the same DynamicInputFormat " +
209+
assertTrue(thirdContext.equals(fourthContext),
210+
"Chunk contexts from the same DynamicInputFormat " +
209211
"object should be the same.");
210-
assertTrue(!firstContext.equals(thirdContext), "Contexts from different DynamicInputFormat " +
212+
assertTrue(!firstContext.equals(thirdContext),
213+
"Contexts from different DynamicInputFormat " +
211214
"objects should be different.");
212215
}
213216
}

0 commit comments

Comments
 (0)