YARN-9765. SLS runner crashes when run with metrics turned off. Contributed by Abhishek Modi.
(cherry picked from commit 10ec31d20e
)
This commit is contained in:
parent
e0a5fee7f5
commit
3547261749
|
@ -76,6 +76,7 @@ import org.apache.hadoop.yarn.sls.conf.SLSConfiguration;
|
||||||
import org.apache.hadoop.yarn.sls.nodemanager.NMSimulator;
|
import org.apache.hadoop.yarn.sls.nodemanager.NMSimulator;
|
||||||
import org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher;
|
import org.apache.hadoop.yarn.sls.resourcemanager.MockAMLauncher;
|
||||||
import org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler;
|
import org.apache.hadoop.yarn.sls.scheduler.SLSCapacityScheduler;
|
||||||
|
import org.apache.hadoop.yarn.sls.scheduler.SchedulerMetrics;
|
||||||
import org.apache.hadoop.yarn.sls.scheduler.TaskRunner;
|
import org.apache.hadoop.yarn.sls.scheduler.TaskRunner;
|
||||||
import org.apache.hadoop.yarn.sls.scheduler.SLSFairScheduler;
|
import org.apache.hadoop.yarn.sls.scheduler.SLSFairScheduler;
|
||||||
import org.apache.hadoop.yarn.sls.scheduler.ContainerSimulator;
|
import org.apache.hadoop.yarn.sls.scheduler.ContainerSimulator;
|
||||||
|
@ -732,7 +733,10 @@ public class SLSRunner extends Configured implements Tool {
|
||||||
}
|
}
|
||||||
|
|
||||||
queueAppNumMap.put(queueName, appNum);
|
queueAppNumMap.put(queueName, appNum);
|
||||||
wrapper.getSchedulerMetrics().trackQueue(queueName);
|
SchedulerMetrics metrics = wrapper.getSchedulerMetrics();
|
||||||
|
if (metrics != null) {
|
||||||
|
metrics.trackQueue(queueName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runNewAM(String jobType, String user,
|
private void runNewAM(String jobType, String user,
|
||||||
|
|
Loading…
Reference in New Issue