Skip to content

Commit 0d6ff04

Browse files
removed extra spaces from TestProportionalCapacityPreemptionPolicy.java
1 parent d701dc6 commit 0d6ff04

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/monitor/capacity/TestProportionalCapacityPreemptionPolicy.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public void testProportionalPreemption() {
229229
// A will preempt guaranteed-allocated.
230230
verify(mDisp, times(10)).handle(argThat(new IsPreemptionRequestFor(appA)));
231231
}
232-
232+
233233
@Test
234234
public void testMaxCap() {
235235
int[][] qData = new int[][]{
@@ -249,7 +249,7 @@ public void testMaxCap() {
249249
verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appA)));
250250
}
251251

252-
252+
253253
@Test
254254
public void testPreemptCycle() {
255255
int[][] qData = new int[][]{
@@ -385,10 +385,10 @@ public void testPerQueueDisablePreemptionHierarchical() {
385385
};
386386
ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData);
387387
policy.editSchedule();
388-
// verify capacity taken from queueB (appA), not queueE (appC) despite
388+
// verify capacity taken from queueB (appA), not queueE (appC) despite
389389
// queueE being far over its absolute capacity because queueA (queueB's
390390
// parent) is over capacity and queueD (queueE's parent) is not.
391-
ApplicationAttemptId expectedAttemptOnQueueB =
391+
ApplicationAttemptId expectedAttemptOnQueueB =
392392
ApplicationAttemptId.newInstance(
393393
appA.getApplicationId(), appA.getAttemptId());
394394
assertTrue("appA should be running on queueB",
@@ -401,10 +401,10 @@ public void testPerQueueDisablePreemptionHierarchical() {
401401
conf.setPreemptionDisabled("root.queueA.queueB", true);
402402
ProportionalCapacityPreemptionPolicy policy2 = buildPolicy(qData);
403403
policy2.editSchedule();
404-
ApplicationAttemptId expectedAttemptOnQueueC =
404+
ApplicationAttemptId expectedAttemptOnQueueC =
405405
ApplicationAttemptId.newInstance(
406406
appB.getApplicationId(), appB.getAttemptId());
407-
ApplicationAttemptId expectedAttemptOnQueueE =
407+
ApplicationAttemptId expectedAttemptOnQueueE =
408408
ApplicationAttemptId.newInstance(
409409
appC.getApplicationId(), appC.getAttemptId());
410410
// Now, all of queueB's (appA) over capacity is not preemptable, so neither
@@ -422,7 +422,7 @@ public void testPerQueueDisablePreemptionHierarchical() {
422422
@Test
423423
public void testPerQueueDisablePreemptionBroadHierarchical() {
424424
int[][] qData = new int[][] {
425-
// / A D G
425+
// / A D G
426426
// B C E F H I
427427
{1000, 350, 150, 200, 400, 200, 200, 250, 100, 150 }, // abs
428428
{1000,1000,1000,1000,1000,1000,1000,1000,1000,1000 }, // maxCap
@@ -473,15 +473,15 @@ public void testPerQueueDisablePreemptionBroadHierarchical() {
473473
@Test
474474
public void testPerQueueDisablePreemptionInheritParent() {
475475
int[][] qData = new int[][] {
476-
// / A E
476+
// / A E
477477
// B C D F G H
478478
{1000, 500, 200, 200, 100, 500, 200, 200, 100 }, // abs (guar)
479479
{1000,1000,1000,1000,1000,1000,1000,1000,1000 }, // maxCap
480-
{1000, 700, 0, 350, 350, 300, 0, 200, 100 }, // used
480+
{1000, 700, 0, 350, 350, 300, 0, 200, 100 }, // used
481481
{ 200, 0, 0, 0, 0, 200, 200, 0, 0 }, // pending
482482
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // reserved
483-
// appA appB appC appD appE
484-
{ 5, 2, 0, 1, 1, 3, 1, 1, 1 }, // apps
483+
// appA appB appC appD appE
484+
{ 5, 2, 0, 1, 1, 3, 1, 1, 1 }, // apps
485485
{ -1, -1, 1, 1, 1, -1, 1, 1, 1 }, // req granulrity
486486
{ 2, 3, 0, 0, 0, 3, 0, 0, 0 }, // subqueues
487487
};
@@ -532,7 +532,7 @@ public void testPerQueuePreemptionNotAllUntouchable() {
532532
@Test
533533
public void testPerQueueDisablePreemptionRootDisablesAll() {
534534
int[][] qData = new int[][] {
535-
// / A D G
535+
// / A D G
536536
// B C E F H I
537537
{1000, 500, 250, 250, 250, 100, 150, 250, 100, 150 }, // abs
538538
{1000,1000,1000,1000,1000,1000,1000,1000,1000,1000 }, // maxCap
@@ -704,7 +704,7 @@ public void testZeroGuar() {
704704
// its absolute guaranteed capacity
705705
verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appA)));
706706
}
707-
707+
708708
@Test
709709
public void testZeroGuarOverCap() {
710710
int[][] qData = new int[][] {
@@ -727,11 +727,11 @@ public void testZeroGuarOverCap() {
727727
verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appC)));
728728
verify(mDisp, never()).handle(argThat(new IsPreemptionRequestFor(appD)));
729729
}
730-
730+
731731
@Test
732732
public void testHierarchicalLarge() {
733733
int[][] qData = new int[][] {
734-
// / A D G
734+
// / A D G
735735
// B C E F H I
736736
{ 400, 200, 60, 140, 100, 70, 30, 100, 10, 90 }, // abs
737737
{ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400 }, // maxCap
@@ -788,17 +788,17 @@ public void testContainerOrdering(){
788788
assert containers.get(4).equals(rm5);
789789

790790
}
791-
791+
792792
@Test
793793
public void testPolicyInitializeAfterSchedulerInitialized() {
794794
@SuppressWarnings("resource")
795795
MockRM rm = new MockRM(conf);
796796
rm.init(conf);
797797

798798
// ProportionalCapacityPreemptionPolicy should be initialized after
799-
// CapacityScheduler initialized. We will
800-
// 1) find SchedulingMonitor from RMActiveService's service list,
801-
// 2) check if ResourceCalculator in policy is null or not.
799+
// CapacityScheduler initialized. We will
800+
// 1) find SchedulingMonitor from RMActiveService's service list,
801+
// 2) check if ResourceCalculator in policy is null or not.
802802
// If it's not null, we can come to a conclusion that policy initialized
803803
// after scheduler got initialized
804804
// Get SchedulingMonitor from SchedulingMonitorManager instead
@@ -812,10 +812,10 @@ public void testPolicyInitializeAfterSchedulerInitialized() {
812812
assertNotNull(policy.getResourceCalculator());
813813
return;
814814
}
815-
815+
816816
fail("Failed to find SchedulingMonitor service, please check what happened");
817817
}
818-
818+
819819
@Test
820820
public void testSkipAMContainer() {
821821
int[][] qData = new int[][] {
@@ -832,7 +832,7 @@ public void testSkipAMContainer() {
832832
setAMContainer = true;
833833
ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData);
834834
policy.editSchedule();
835-
835+
836836
// By skipping AM Container, all other 24 containers of appD will be
837837
// preempted
838838
verify(mDisp, times(24)).handle(argThat(new IsPreemptionRequestFor(appD)));
@@ -863,13 +863,13 @@ public void testPreemptSkippedAMContainers() {
863863
setAMContainer = true;
864864
ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData);
865865
policy.editSchedule();
866-
866+
867867
// All 5 containers of appD will be preempted including AM container.
868868
verify(mDisp, times(5)).handle(argThat(new IsPreemptionRequestFor(appD)));
869869

870870
// All 5 containers of appC will be preempted including AM container.
871871
verify(mDisp, times(5)).handle(argThat(new IsPreemptionRequestFor(appC)));
872-
872+
873873
// By skipping AM Container, all other 4 containers of appB will be
874874
// preempted
875875
verify(mDisp, times(4)).handle(argThat(new IsPreemptionRequestFor(appB)));
@@ -879,7 +879,7 @@ public void testPreemptSkippedAMContainers() {
879879
verify(mDisp, times(4)).handle(argThat(new IsPreemptionRequestFor(appA)));
880880
setAMContainer = false;
881881
}
882-
882+
883883
@Test
884884
public void testAMResourcePercentForSkippedAMContainers() {
885885
int[][] qData = new int[][] {
@@ -897,7 +897,7 @@ public void testAMResourcePercentForSkippedAMContainers() {
897897
setAMResourcePercent = 0.5f;
898898
ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData);
899899
policy.editSchedule();
900-
900+
901901
// AMResoucePercent is 50% of cluster and maxAMCapacity will be 5Gb.
902902
// Total used AM container size is 20GB, hence 2 AM container has
903903
// to be preempted as Queue Capacity is 10Gb.
@@ -906,7 +906,7 @@ public void testAMResourcePercentForSkippedAMContainers() {
906906
// Including AM Container, all other 4 containers of appC will be
907907
// preempted
908908
verify(mDisp, times(5)).handle(argThat(new IsPreemptionRequestFor(appC)));
909-
909+
910910
// By skipping AM Container, all other 4 containers of appB will be
911911
// preempted
912912
verify(mDisp, times(4)).handle(argThat(new IsPreemptionRequestFor(appB)));
@@ -1395,7 +1395,7 @@ LeafQueue mockLeafQueue(ParentQueue p, Resource tot, int i, Resource[] abs,
13951395
when(mCS.getQueue(queuePath)).thenReturn(lq);
13961396

13971397
ResourceCalculator rc = mCS.getResourceCalculator();
1398-
List<ApplicationAttemptId> appAttemptIdList =
1398+
List<ApplicationAttemptId> appAttemptIdList =
13991399
new ArrayList<ApplicationAttemptId>();
14001400
when(lq.getTotalPendingResourcesConsideringUserLimit(isA(Resource.class),
14011401
isA(String.class), eq(false))).thenReturn(pending[i]);

0 commit comments

Comments
 (0)