-
Notifications
You must be signed in to change notification settings - Fork 9.1k
YARN-11003. Make RMNode aware of all (OContainer inclusive) allocated resources #3646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… resources * Adds a new method in RMNode: getAllocatedContainerResource, which records how much resource is allocated to containers on a node * Adds up RUNNING and NEW container resources in HB loop to keep track of resources allocated for containers
newContainerStatusFromNode, runningContainerStatusFromNode)) | ||
.when(statusEventFromNode1).getContainers(); | ||
node.handle(statusEventFromNode1); | ||
Assert.assertTrue(Resources.equals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resource has equals which actual is called by this, can't we just use assertEquals()?
rmContext.getRMApps().put(app0, Mockito.mock(RMApp.class)); | ||
|
||
RMNodeStatusEvent statusEventFromNode1 = getMockRMNodeStatusEvent(null); | ||
ContainerStatus newContainerStatusFromNode = mock(ContainerStatus.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create this mock in a static method to make the test easier to read?
...nager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
Show resolved
Hide resolved
.when(statusEventFromNode2).getContainers(); | ||
|
||
node.handle(statusEventFromNode2); | ||
Assert.assertTrue(Resources.equals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertEquals()
...nager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
Show resolved
Hide resolved
@goiri thanks for the review! Have pushed a new commit to address your comments. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
|
||
// Adding completed containers should not have changed | ||
// the resources allocated | ||
Assert.assertEquals(node.getAllocatedContainerResource(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we would put the expected first in the assertEquals
🎊 +1 overall
This message was automatically generated. |
@@ -104,6 +105,14 @@ | |||
*/ | |||
public Resource getTotalCapability(); | |||
|
|||
/** | |||
* the total allocated resources to containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start with upper case in comments.. This will include the sum of O+G containers queued + running + paused on the node.. Comment cane be more explanatory..
...cemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java
Show resolved
Hide resolved
...nager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestRMNodeTransitions.java
Show resolved
Hide resolved
@bibinchundatt thanks for the review! Updated the PR to address your comments. |
🎊 +1 overall
This message was automatically generated. |
Description of PR
records how much resource is allocated to containers on a node
of resources allocated for containers
How was this patch tested?