[
https://issues.apache.org/jira/browse/YARN-1333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13802246#comment-13802246
]
Sandy Ryza commented on YARN-1333:
----------------------------------
Thanks for working on this, Tsuyoshi. It might make sense to wait for
YARN-1335 (which I'll try to get in ASAP) so we can share updateBlacklist with
FiCaSchedulerApp. A few comments in the mean time:
{code}
+ public void testBlackListNodes() throws Exception {
{code}
We should follow the convention of now capitalizing the "L" in blacklist.
{code}
+ resourceManager.start();
+ FairScheduler fs = (FairScheduler) resourceManager.getResourceScheduler();
{code}
This is not required. As in the other tests, we don't need to start the
resource manager, and we can refer to the already existing scheduler instance
variable.
{code}
+
+ ApplicationId appId = BuilderUtils.newApplicationId(100, 1);
+ ApplicationAttemptId appAttemptId = BuilderUtils.newApplicationAttemptId(
+ appId, 1);
+ SchedulerEvent event = new AppAddedSchedulerEvent(appAttemptId, "default",
+ "user");
{code}
This should be done with createSchedulingRequest
{code}
+ // Verify the blacklist can be updated independent of requesting containers
+ fs.allocate(appAttemptId, Collections.<ResourceRequest>emptyList(),
+ Collections.<ContainerId>emptyList(),
+ Collections.singletonList(host), null);
+ Assert.assertTrue(fs.getApplication(appAttemptId).isBlacklisted(host));
+ fs.allocate(appAttemptId, Collections.<ResourceRequest>emptyList(),
+ Collections.<ContainerId>emptyList(), null,
+ Collections.singletonList(host));
{code}
Indentation for the overflow lines should be 4 spaces, not 2. Also, assertTrue
and assertFalse are imported statically so no need to prefix with Assert.
Third, instead of adding and calling a new getApplication method, we can just
do what the other tests do and call scheduler.applications.get() directly.
Lastly, the test should verify that an container does not actually get place on
the blacklisted host. You can take a look at a test like testMaxAssign to see
how a test verifies that a container is not placed.
> Support blacklisting in the Fair Scheduler
> ------------------------------------------
>
> Key: YARN-1333
> URL: https://issues.apache.org/jira/browse/YARN-1333
> Project: Hadoop YARN
> Issue Type: Improvement
> Components: scheduler
> Affects Versions: 2.2.0
> Reporter: Sandy Ryza
> Assignee: Tsuyoshi OZAWA
> Attachments: YARN-1333.1.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.1#6144)