Skip to content

Commit 92f15fb

Browse files
author
fanshilun
committed
HADOOP-19425. Fix CheckStyle.
1 parent 8852f97 commit 92f15fb

File tree

8 files changed

+50
-54
lines changed

8 files changed

+50
-54
lines changed

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AbstractWasbTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setUp(TestInfo testInfo) throws Exception {
5959

6060
@AfterEach
6161
public void tearDown(TestInfo info) throws Exception {
62-
describe(info,"closing test account and filesystem");
62+
describe(info, "closing test account and filesystem");
6363
testAccount = cleanupTestAccount(testAccount);
6464
IOUtils.closeStream(fs);
6565
fs = null;

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/ITestWasbUriAndConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import org.apache.hadoop.test.GenericTestUtils;
5050

5151
import org.junit.jupiter.api.AfterEach;
52-
import org.junit.jupiter.api.Assertions;
5352
import org.junit.jupiter.api.BeforeEach;
5453
import org.junit.jupiter.api.Test;
5554
import org.junit.jupiter.api.io.TempDir;

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/NativeAzureFileSystemBaseTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,9 +1537,9 @@ private void testModifiedTime(Path testPath) throws Exception {
15371537
final long errorMargin = 60 * 1000; // Give it +/-60 seconds
15381538
assertTrue(
15391539
fileStatus.getModificationTime() > (currentUtcTime - errorMargin) &&
1540-
fileStatus.getModificationTime() < (currentUtcTime + errorMargin), "Modification time " +
1541-
new Date(fileStatus.getModificationTime()) + " is not close to now: " +
1542-
utc.getTime());
1540+
fileStatus.getModificationTime() < (currentUtcTime + errorMargin),
1541+
"Modification time " + new Date(fileStatus.getModificationTime())
1542+
+ " is not close to now: " + utc.getTime());
15431543
}
15441544

15451545
private void createEmptyFile(Path testFile, FsPermission permission)

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestClientThrottlingAnalyzer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ private void fuzzyValidate(long expected, long actual, double percentage) {
4444
final double upperBound = expected + percentage / 100 * expected;
4545

4646
assertTrue(actual >= lowerBound && actual <= upperBound, String.format(
47-
"The actual value %1$d is not within the expected range: " +
48-
"[%2$.2f, %3$.2f].",
47+
"The actual value %1$d is not within the expected range: "
48+
+ "[%2$.2f, %3$.2f].",
4949
actual,
5050
lowerBound,
5151
upperBound));

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestNativeAzureFileSystemBlockCompaction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.apache.hadoop.fs.FSDataOutputStream;
2525
import org.apache.hadoop.fs.Path;
2626
import org.apache.hadoop.fs.contract.ContractTestUtils;
27-
import org.junit.jupiter.api.Assertions;
2827
import org.junit.jupiter.api.BeforeEach;
2928
import org.junit.jupiter.api.Test;
3029
import org.junit.jupiter.api.TestInfo;

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/integration/AzureTestUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ public static String verifyWasbAccountNameInConfig(Configuration conf) {
495495
if (accountName == null) {
496496
accountName = conf.get(WASB_TEST_ACCOUNT_NAME_WITH_DOMAIN);
497497
}
498-
assumeTrue(accountName != null &&
499-
!accountName.endsWith(WASB_ACCOUNT_NAME_DOMAIN_SUFFIX_REGEX),
498+
assumeTrue(accountName != null && !accountName.endsWith(WASB_ACCOUNT_NAME_DOMAIN_SUFFIX_REGEX),
500499
"Account for WASB is missing or it is not in correct format");
501500
return accountName;
502501
}

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/integration/ITestAzureHugeFiles.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected void deleteTestDirInTeardown() throws IOException {
122122
}
123123

124124
protected void deleteHugeFile(TestInfo info) throws IOException {
125-
describe(info,"Deleting %s", hugefile);
125+
describe(info, "Deleting %s", hugefile);
126126
ContractTestUtils.NanoTimer timer = new ContractTestUtils.NanoTimer();
127127
getFileSystem().delete(hugefile, false);
128128
timer.end("time to delete %s", hugefile);

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/metrics/ITestAzureFileSystemInstrumentation.java

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -156,35 +156,35 @@ public void testMetricsOnFileCreateRead() throws Exception {
156156
getBandwidthGaugeUpdater().triggerUpdate(true);
157157
long bytesWritten = AzureMetricsTestUtil.getCurrentBytesWritten(getInstrumentation());
158158
assertTrue(bytesWritten > (FILE_SIZE / 2) && bytesWritten < (FILE_SIZE * 2),
159-
"The bytes written in the last second " + bytesWritten +
160-
" is pretty far from the expected range of around " + FILE_SIZE +
161-
" bytes plus a little overhead.");
159+
"The bytes written in the last second " + bytesWritten
160+
+ " is pretty far from the expected range of around " + FILE_SIZE
161+
+ " bytes plus a little overhead.");
162162
long totalBytesWritten = AzureMetricsTestUtil.getCurrentTotalBytesWritten(getInstrumentation());
163163
assertTrue(totalBytesWritten >= FILE_SIZE && totalBytesWritten < (FILE_SIZE * 2),
164-
"The total bytes written " + totalBytesWritten +
165-
" is pretty far from the expected range of around " + FILE_SIZE +
166-
" bytes plus a little overhead.");
164+
"The total bytes written " + totalBytesWritten
165+
+ " is pretty far from the expected range of around " + FILE_SIZE
166+
+ " bytes plus a little overhead.");
167167
long uploadRate = AzureMetricsTestUtil.getLongGaugeValue(getInstrumentation(), WASB_UPLOAD_RATE);
168168
LOG.info("Upload rate: " + uploadRate + " bytes/second.");
169169
long expectedRate = (FILE_SIZE * 1000L) / uploadDurationMs;
170-
assertTrue(uploadRate >= expectedRate, "The upload rate " + uploadRate +
171-
" is below the expected range of around " + expectedRate +
172-
" bytes/second that the unit test observed. This should never be" +
173-
" the case since the test underestimates the rate by looking at " +
174-
" end-to-end time instead of just block upload time.");
170+
assertTrue(uploadRate >= expectedRate, "The upload rate " + uploadRate
171+
+ " is below the expected range of around " + expectedRate
172+
+ " bytes/second that the unit test observed. This should never be"
173+
+ " the case since the test underestimates the rate by looking at "
174+
+ " end-to-end time instead of just block upload time.");
175175
long uploadLatency = AzureMetricsTestUtil.getLongGaugeValue(getInstrumentation(),
176176
WASB_UPLOAD_LATENCY);
177177
LOG.info("Upload latency: {}", uploadLatency);
178178
long expectedLatency = uploadDurationMs; // We're uploading less than a block.
179179
assertTrue(uploadLatency > 0,
180-
"The upload latency " + uploadLatency +
181-
" should be greater than zero now that I've just uploaded a file.");
180+
"The upload latency " + uploadLatency
181+
+ " should be greater than zero now that I've just uploaded a file.");
182182
assertTrue(uploadLatency <= expectedLatency,
183-
"The upload latency " + uploadLatency +
184-
" is more than the expected range of around " + expectedLatency +
185-
" milliseconds that the unit test observed. This should never be" +
186-
" the case since the test overestimates the latency by looking at " +
187-
" end-to-end time instead of just block upload time.");
183+
"The upload latency " + uploadLatency
184+
+ " is more than the expected range of around " + expectedLatency
185+
+ " milliseconds that the unit test observed. This should never be"
186+
+ " the case since the test overestimates the latency by looking at "
187+
+ " end-to-end time instead of just block upload time.");
188188

189189
// Read the file
190190
start = new Date();
@@ -207,31 +207,31 @@ public void testMetricsOnFileCreateRead() throws Exception {
207207
assertEquals(FILE_SIZE, totalBytesRead);
208208
long bytesRead = AzureMetricsTestUtil.getCurrentBytesRead(getInstrumentation());
209209
assertTrue(bytesRead > (FILE_SIZE / 2) && bytesRead < (FILE_SIZE * 2),
210-
"The bytes read in the last second " + bytesRead +
211-
" is pretty far from the expected range of around " + FILE_SIZE +
212-
" bytes plus a little overhead.");
210+
"The bytes read in the last second " + bytesRead
211+
+ " is pretty far from the expected range of around " + FILE_SIZE
212+
+ " bytes plus a little overhead.");
213213
long downloadRate = AzureMetricsTestUtil.getLongGaugeValue(getInstrumentation(), WASB_DOWNLOAD_RATE);
214214
LOG.info("Download rate: " + downloadRate + " bytes/second.");
215215
expectedRate = (FILE_SIZE * 1000L) / downloadDurationMs;
216216
assertTrue(downloadRate >= expectedRate,
217-
"The download rate " + downloadRate +
218-
" is below the expected range of around " + expectedRate +
219-
" bytes/second that the unit test observed. This should never be" +
220-
" the case since the test underestimates the rate by looking at " +
221-
" end-to-end time instead of just block download time.");
217+
"The download rate " + downloadRate
218+
+ " is below the expected range of around " + expectedRate
219+
+ " bytes/second that the unit test observed. This should never be"
220+
+ " the case since the test underestimates the rate by looking at "
221+
+ " end-to-end time instead of just block download time.");
222222
long downloadLatency = AzureMetricsTestUtil.getLongGaugeValue(getInstrumentation(),
223223
WASB_DOWNLOAD_LATENCY);
224224
LOG.info("Download latency: " + downloadLatency);
225225
expectedLatency = downloadDurationMs; // We're downloading less than a block.
226226
assertTrue(downloadLatency > 0,
227-
"The download latency " + downloadLatency +
228-
" should be greater than zero now that I've just downloaded a file.");
227+
"The download latency " + downloadLatency
228+
+ " should be greater than zero now that I've just downloaded a file.");
229229
assertTrue(downloadLatency <= expectedLatency,
230-
"The download latency " + downloadLatency +
231-
" is more than the expected range of around " + expectedLatency +
232-
" milliseconds that the unit test observed. This should never be" +
233-
" the case since the test overestimates the latency by looking at " +
234-
" end-to-end time instead of just block download time.");
230+
"The download latency " + downloadLatency
231+
+ " is more than the expected range of around " + expectedLatency
232+
+ " milliseconds that the unit test observed. This should never be"
233+
+ " the case since the test overestimates the latency by looking at "
234+
+ " end-to-end time instead of just block download time.");
235235

236236
assertNoErrors();
237237
}
@@ -265,17 +265,17 @@ public void testMetricsOnBigFileCreateRead() throws Exception {
265265
getBandwidthGaugeUpdater().triggerUpdate(true);
266266
long totalBytesWritten = AzureMetricsTestUtil.getCurrentTotalBytesWritten(getInstrumentation());
267267
assertTrue(totalBytesWritten >= FILE_SIZE && totalBytesWritten < (FILE_SIZE * 2),
268-
"The total bytes written " + totalBytesWritten +
269-
" is pretty far from the expected range of around " + FILE_SIZE +
270-
" bytes plus a little overhead.");
268+
"The total bytes written " + totalBytesWritten
269+
+ " is pretty far from the expected range of around " + FILE_SIZE
270+
+ " bytes plus a little overhead.");
271271
long uploadRate = AzureMetricsTestUtil.getLongGaugeValue(getInstrumentation(), WASB_UPLOAD_RATE);
272272
LOG.info("Upload rate: " + uploadRate + " bytes/second.");
273273
long uploadLatency = AzureMetricsTestUtil.getLongGaugeValue(getInstrumentation(),
274274
WASB_UPLOAD_LATENCY);
275275
LOG.info("Upload latency: " + uploadLatency);
276276
assertTrue(uploadLatency > 0,
277-
"The upload latency " + uploadLatency +
278-
" should be greater than zero now that I've just uploaded a file.");
277+
"The upload latency " + uploadLatency
278+
+ " should be greater than zero now that I've just uploaded a file.");
279279

280280
// Read the file
281281
InputStream inputStream = getFileSystem().open(filePath);
@@ -300,8 +300,8 @@ public void testMetricsOnBigFileCreateRead() throws Exception {
300300
WASB_DOWNLOAD_LATENCY);
301301
LOG.info("Download latency: " + downloadLatency);
302302
assertTrue(downloadLatency > 0,
303-
"The download latency " + downloadLatency +
304-
" should be greater than zero now that I've just downloaded a file.");
303+
"The download latency " + downloadLatency
304+
+ " should be greater than zero now that I've just downloaded a file.");
305305
}
306306

307307
@Test
@@ -481,9 +481,8 @@ private long assertWebResponsesInRange(long base,
481481
long inclusiveUpperLimit) {
482482
long currentResponses = getCurrentWebResponses();
483483
long justOperation = currentResponses - base;
484-
assertTrue(justOperation >= inclusiveLowerLimit &&
485-
justOperation <= inclusiveUpperLimit, String.format(
486-
"Web responses expected in range [%d, %d], but was %d.",
484+
assertTrue(justOperation >= inclusiveLowerLimit && justOperation <= inclusiveUpperLimit,
485+
String.format("Web responses expected in range [%d, %d], but was %d.",
487486
inclusiveLowerLimit, inclusiveUpperLimit, justOperation));
488487
return currentResponses;
489488
}

0 commit comments

Comments
 (0)