[ https://issues.apache.org/jira/browse/YARN-6194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15879093#comment-15879093 ] ASF GitHub Bot commented on YARN-6194: -------------------------------------- Github user kambatla commented on a diff in the pull request: https://github.com/apache/hadoop/pull/196#discussion_r102554581 --- Diff: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSContext.java --- @@ -27,28 +29,37 @@ private boolean preemptionEnabled = false; private float preemptionUtilizationThreshold; private FSStarvedApps starvedApps; + private FairScheduler scheduler; + + FSContext(FairScheduler scheduler) { + this.scheduler = scheduler; + } - public boolean isPreemptionEnabled() { + boolean isPreemptionEnabled() { return preemptionEnabled; } - public void setPreemptionEnabled() { + void setPreemptionEnabled() { this.preemptionEnabled = true; if (starvedApps == null) { starvedApps = new FSStarvedApps(); } } - public FSStarvedApps getStarvedApps() { + FSStarvedApps getStarvedApps() { return starvedApps; } - public float getPreemptionUtilizationThreshold() { + float getPreemptionUtilizationThreshold() { return preemptionUtilizationThreshold; } - public void setPreemptionUtilizationThreshold( + void setPreemptionUtilizationThreshold( float preemptionUtilizationThreshold) { this.preemptionUtilizationThreshold = preemptionUtilizationThreshold; } + + public Resource getClusterResource() { + return scheduler.getClusterResource(); --- End diff -- This looks okay for now, but this allows a scheduling policy to modify the overall cluster's resources. Making a copy could be expensive, as this is called on every compare call. > Cluster capacity in SchedulingPolicy is updated only on allocation file reload > ------------------------------------------------------------------------------ > > Key: YARN-6194 > URL: https://issues.apache.org/jira/browse/YARN-6194 > Project: Hadoop YARN > Issue Type: Improvement > Components: fairscheduler > Affects Versions: 2.8.0 > Reporter: Karthik Kambatla > Assignee: Yufei Gu > > Some of the {{SchedulingPolicy}} methods need cluster capacity which is set using {{#initialize}} today. However, {{initialize()}} is called only on allocation reload. If nodes are added between reloads, the cluster capacity is not considered until the next reload. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org