Skip to content

Commit 6794dae

Browse files
committed
YARN-11262. Fix CheckStyle.
1 parent cd0934b commit 6794dae

File tree

13 files changed

+62
-60
lines changed

13 files changed

+62
-60
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestAMRMTokens.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ public void testMasterKeyRollOver(Configuration pConf) throws Exception {
302302

303303
MasterKeyData newKey = appTokenSecretManager.getMasterKey();
304304
assertNotNull(newKey);
305-
assertFalse(
306-
oldKey.equals(newKey), "Master key should have changed!");
305+
assertFalse(oldKey.equals(newKey), "Master key should have changed!");
307306

308307
// Another allocate call with old AMRMToken. Should continue to work.
309308
rpc.stopProxy(rmClient, conf); // To avoid using cached client

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/security/TestDelegationTokenRenewer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ public void testDTRenewal () throws Exception {
494494
";Counter = " + Renewer.counter + ";t="+ Renewer.lastRenewed);
495495
assertEquals(numberOfExpectedRenewals, Renewer.counter,
496496
"renew wasn't called as many times as expected(4):");
497-
assertEquals(Renewer.lastRenewed,
497+
assertEquals(Renewer.lastRenewed,
498498
token1, "most recently renewed token mismatch");
499499

500500
// Test 2.
@@ -943,7 +943,7 @@ public void testDTRonAppSubmission()
943943

944944
}
945945

946-
@Test
946+
@Test
947947
@Timeout(value = 20)
948948
public void testConcurrentAddApplication()
949949
throws IOException, InterruptedException, BrokenBarrierException {

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/volume/csi/TestVolumeCapabilityRange.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,32 @@ public class TestVolumeCapabilityRange {
3232
@Test
3333
public void testInvalidMinCapability() throws InvalidVolumeException {
3434
assertThrows(InvalidVolumeException.class, () -> {
35-
VolumeCapabilityRange.newBuilder()
36-
.minCapacity(-1L)
37-
.maxCapacity(5L)
38-
.unit("Gi")
39-
.build();
35+
VolumeCapabilityRange.newBuilder()
36+
.minCapacity(-1L)
37+
.maxCapacity(5L)
38+
.unit("Gi")
39+
.build();
4040
});
4141
}
4242

4343
@Test
4444
public void testMissingMinCapability() throws InvalidVolumeException {
4545
assertThrows(InvalidVolumeException.class, () -> {
46-
VolumeCapabilityRange.newBuilder()
47-
.maxCapacity(5L)
48-
.unit("Gi")
49-
.build();
46+
VolumeCapabilityRange.newBuilder()
47+
.maxCapacity(5L)
48+
.unit("Gi")
49+
.build();
5050
});
5151

5252
}
5353

5454
@Test
5555
public void testMissingUnit() throws InvalidVolumeException {
5656
assertThrows(InvalidVolumeException.class, () -> {
57-
VolumeCapabilityRange.newBuilder()
58-
.minCapacity(0L)
59-
.maxCapacity(5L)
60-
.build();
57+
VolumeCapabilityRange.newBuilder()
58+
.minCapacity(0L)
59+
.maxCapacity(5L)
60+
.build();
6161
});
6262
}
6363

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServices.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,10 @@ public void verifyClusterMetrics(int submittedApps, int completedApps,
528528

529529
assertEquals(0, containersAlloc, "containersAllocated doesn't match");
530530
assertEquals(totalMBExpect, totalMB, "totalMB doesn't match");
531-
assertEquals(
532-
clusterMetrics.getNumActiveNMs() + clusterMetrics.getNumLostNMs()
533-
+ clusterMetrics.getNumDecommisionedNMs()
534-
+ clusterMetrics.getNumRebootedNMs()
535-
+ clusterMetrics.getUnhealthyNMs(), totalNodes, "totalNodes doesn't match");
531+
assertEquals(clusterMetrics.getNumActiveNMs() + clusterMetrics.getNumLostNMs()
532+
+ clusterMetrics.getNumDecommisionedNMs()
533+
+ clusterMetrics.getNumRebootedNMs()
534+
+ clusterMetrics.getUnhealthyNMs(), totalNodes, "totalNodes doesn't match");
536535
assertEquals(clusterMetrics.getNumLostNMs(), lostNodes, "lostNodes doesn't match");
537536
assertEquals(clusterMetrics.getUnhealthyNMs(), unhealthyNodes,
538537
"unhealthyNodes doesn't match");

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ public void testAppsQueryStatesComma() throws JSONException, Exception {
405405
array = apps.getJSONArray("app");
406406
assertEquals(2, array.length(), "incorrect number of elements");
407407
assertTrue(
408-
(array.getJSONObject(0).getString("state").equals("ACCEPTED") &&
408+
(array.getJSONObject(0).getString("state").equals("ACCEPTED") &&
409409
array.getJSONObject(1).getString("state").equals("KILLED")) ||
410410
(array.getJSONObject(0).getString("state").equals("KILLED") &&
411411
array.getJSONObject(1).getString("state").equals("ACCEPTED")),
@@ -1869,7 +1869,7 @@ public void verifyAppInfoGeneric(RMApp app, String id, String user,
18691869
state);
18701870
WebServicesTestUtils.checkStringMatch("finalStatus", app
18711871
.getFinalApplicationStatus().toString(), finalStatus);
1872-
assertEquals( 0, progress, 0.0, "progress doesn't match");
1872+
assertEquals(0, progress, 0.0, "progress doesn't match");
18731873
if ("UNASSIGNED".equals(trackingUI)) {
18741874
WebServicesTestUtils.checkStringMatch("trackingUI", "UNASSIGNED",
18751875
trackingUI);
@@ -1939,8 +1939,8 @@ public void verifyResourceRequestsGeneric(ResourceRequest request,
19391939
String nodeLabelExpression, int numContainers, boolean relaxLocality,
19401940
int priority, String resourceName, long memory, long vCores,
19411941
String executionType, boolean enforceExecutionType) {
1942-
assertEquals(
1943-
request.getNodeLabelExpression(), nodeLabelExpression, "nodeLabelExpression doesn't match");
1942+
assertEquals(request.getNodeLabelExpression(), nodeLabelExpression,
1943+
"nodeLabelExpression doesn't match");
19441944
assertEquals(request.getNumContainers(),
19451945
numContainers, "numContainers doesn't match");
19461946
assertEquals(request.getRelaxLocality(),

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesAppsModification.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ public void testSingleAppKill(int run) throws Exception {
501501
} else {
502502
verifyAppStateXML(response, RMAppState.KILLED);
503503
}
504-
assertTrue(
505-
app.getDiagnostics().toString().contains(diagnostic), "Diagnostic message is incorrect");
504+
assertTrue(app.getDiagnostics().toString().contains(diagnostic),
505+
"Diagnostic message is incorrect");
506506
break;
507507
}
508508
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesCapacitySchedDefaultLabel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void setUp() throws Exception {
102102
}
103103

104104
public void initTestRMWebServicesCapacitySchedDefaultLabel(boolean pLegacyQueueMode)
105-
throws Exception {
105+
throws Exception {
106106
this.legacyQueueMode = pLegacyQueueMode;
107107
backupSchedulerConfigFileInTarget();
108108
setUp();

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesConfigurationMutation.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ public void testUnsetParentQueueOrderingPolicy() throws Exception {
409409
.getConfiguration();
410410
bOrderingPolicy = CapacitySchedulerConfiguration.PREFIX
411411
+ "root.b" + CapacitySchedulerConfiguration.DOT + ORDERING_POLICY;
412-
assertNull(
413-
newCSConf.get(bOrderingPolicy), "Failed to unset Parent Queue OrderingPolicy");
412+
assertNull(newCSConf.get(bOrderingPolicy),
413+
"Failed to unset Parent Queue OrderingPolicy");
414414
}
415415

416416
@Test
@@ -453,8 +453,8 @@ public void testUnsetLeafQueueOrderingPolicy() throws Exception {
453453
.getConfiguration();
454454
cOrderingPolicy = CapacitySchedulerConfiguration.PREFIX
455455
+ "root.c" + CapacitySchedulerConfiguration.DOT + ORDERING_POLICY;
456-
assertNull(
457-
newCSConf.get(cOrderingPolicy), "Failed to unset Leaf Queue OrderingPolicy");
456+
assertNull(newCSConf.get(cOrderingPolicy),
457+
"Failed to unset Leaf Queue OrderingPolicy");
458458
}
459459

460460
@Test
@@ -477,8 +477,8 @@ public void testRemoveQueue() throws Exception {
477477
assertEquals(Status.OK.getStatusCode(), response.getStatus());
478478
CapacitySchedulerConfiguration newCSConf =
479479
((CapacityScheduler) rm.getResourceScheduler()).getConfiguration();
480-
assertEquals(
481-
1, newCSConf.getQueues(ROOT_A).size(), "Failed to remove the queue");
480+
assertEquals(1, newCSConf.getQueues(ROOT_A).size(),
481+
"Failed to remove the queue");
482482
assertEquals("a1", newCSConf.getQueues(ROOT_A).get(0),
483483
"Failed to remove the right queue");
484484
}
@@ -520,8 +520,8 @@ public void testRemoveQueueWhichHasQueueMapping() throws Exception {
520520
CapacityScheduler cs = (CapacityScheduler) rm.getResourceScheduler();
521521

522522
// Validate Queue 'mappedqueue' exists before deletion
523-
assertNotNull(
524-
cs.getQueue("mappedqueue"), "Failed to setup CapacityScheduler Configuration");
523+
assertNotNull(cs.getQueue("mappedqueue"),
524+
"Failed to setup CapacityScheduler Configuration");
525525

526526
// Set state of queue 'mappedqueue' to STOPPED.
527527
SchedConfUpdateInfo updateInfo = new SchedConfUpdateInfo();
@@ -547,8 +547,8 @@ public void testRemoveQueueWhichHasQueueMapping() throws Exception {
547547
CapacitySchedulerConfiguration newCSConf =
548548
((CapacityScheduler) rm.getResourceScheduler()).getConfiguration();
549549
assertEquals(4, newCSConf.getQueues(ROOT).size());
550-
assertNotNull(
551-
cs.getQueue("mappedqueue"), "CapacityScheduler Configuration is corrupt");
550+
assertNotNull(cs.getQueue("mappedqueue"),
551+
"CapacityScheduler Configuration is corrupt");
552552
}
553553

554554
@Test

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesForCSWithPartitions.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,7 @@ private void verifyQueueAInfoXML(Element queueElem) {
470470
Element partitionCapacitiesInfo = (Element) capacitiesListInfos.item(0);
471471
String partitionName = WebServicesTestUtils
472472
.getXmlString(partitionCapacitiesInfo, "partitionName");
473-
assertTrue(
474-
partitionName.isEmpty(), "invalid PartitionCapacityInfo");
473+
assertTrue(partitionName.isEmpty(), "invalid PartitionCapacityInfo");
475474
verifyPartitionCapacityInfoXML(partitionCapacitiesInfo, 30, 0, 50, 30,
476475
0, 50);
477476
} else if (queueChildElem.getTagName().equals("resources")) {
@@ -610,7 +609,7 @@ private void verifyPartitionCapacityInfoXML(Element partitionInfo,
610609
assertEquals(capacity, WebServicesTestUtils.getXmlFloat(partitionInfo, "capacity"),
611610
EPSILON, "capacity doesn't match");
612611
assertEquals(usedCapacity, WebServicesTestUtils.getXmlFloat(partitionInfo, "usedCapacity"),
613-
EPSILON,"capacity doesn't match");
612+
EPSILON, "capacity doesn't match");
614613
assertEquals(maxCapacity, WebServicesTestUtils.getXmlFloat(partitionInfo, "maxCapacity"),
615614
EPSILON, "capacity doesn't match");
616615
assertEquals(absoluteCapacity,
@@ -813,14 +812,14 @@ private void verifyPartitionCapacityInfoJson(
813812
JSONObject partitionCapacityInfoJson, float capacity, float usedCapacity,
814813
float maxCapacity, float absoluteCapacity, float absoluteUsedCapacity,
815814
float absoluteMaxCapacity) throws JSONException {
816-
assertEquals(capacity,
817-
(float) partitionCapacityInfoJson.getDouble("capacity"), EPSILON, "capacity doesn't match");
818-
assertEquals(usedCapacity,
819-
(float) partitionCapacityInfoJson.getDouble("usedCapacity"), EPSILON, "capacity doesn't match");
820-
assertEquals(maxCapacity,
821-
(float) partitionCapacityInfoJson.getDouble("maxCapacity"), EPSILON, "capacity doesn't match");
822-
assertEquals(absoluteCapacity,
823-
(float) partitionCapacityInfoJson.getDouble("absoluteCapacity"), EPSILON, "capacity doesn't match");
815+
assertEquals(capacity, (float) partitionCapacityInfoJson.getDouble("capacity"),
816+
EPSILON, "capacity doesn't match");
817+
assertEquals(usedCapacity, (float) partitionCapacityInfoJson.getDouble("usedCapacity"),
818+
EPSILON, "capacity doesn't match");
819+
assertEquals(maxCapacity, (float) partitionCapacityInfoJson.getDouble("maxCapacity"),
820+
EPSILON, "capacity doesn't match");
821+
assertEquals(absoluteCapacity, (float) partitionCapacityInfoJson.getDouble("absoluteCapacity"),
822+
EPSILON, "capacity doesn't match");
824823
assertEquals(absoluteUsedCapacity,
825824
(float) partitionCapacityInfoJson.getDouble("absoluteUsedCapacity"),
826825
1e-3f, "capacity doesn't match");

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesReservation.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ public void testTimeIntervalRequestListReservation(int run, boolean recurrence)
495495

496496
@MethodSource("guiceConfigs")
497497
@ParameterizedTest
498-
public void testSameTimeIntervalRequestListReservation(int run, boolean recurrence) throws Exception {
498+
public void testSameTimeIntervalRequestListReservation(int run, boolean recurrence)
499+
throws Exception {
499500
initTestRMWebServicesReservation(run, recurrence);
500501
rm.start();
501502
setupCluster(100);
@@ -693,7 +694,8 @@ public void testEmptyEndTimeRequestListReservation(int run, boolean recurrence)
693694

694695
@MethodSource("guiceConfigs")
695696
@ParameterizedTest
696-
public void testInvalidStartTimeRequestListReservation(int run, boolean recurrence) throws Exception {
697+
public void testInvalidStartTimeRequestListReservation(int run, boolean recurrence)
698+
throws Exception {
697699
initTestRMWebServicesReservation(run, recurrence);
698700
rm.start();
699701
setupCluster(100);
@@ -739,7 +741,8 @@ public void testInvalidStartTimeRequestListReservation(int run, boolean recurren
739741

740742
@MethodSource("guiceConfigs")
741743
@ParameterizedTest
742-
public void testEmptyStartTimeRequestListReservation(int run, boolean recurrence) throws Exception {
744+
public void testEmptyStartTimeRequestListReservation(int run, boolean recurrence)
745+
throws Exception {
743746
initTestRMWebServicesReservation(run, recurrence);
744747
rm.start();
745748
setupCluster(100);
@@ -862,7 +865,8 @@ public void testNonExistentQueueRequestListReservation(int run, boolean recurren
862865

863866
@MethodSource("guiceConfigs")
864867
@ParameterizedTest
865-
public void testReservationIdRequestListReservation(int run, boolean recurrence) throws Exception {
868+
public void testReservationIdRequestListReservation(int run, boolean recurrence)
869+
throws Exception {
866870
initTestRMWebServicesReservation(run, recurrence);
867871
rm.start();
868872
setupCluster(100);

0 commit comments

Comments
 (0)