The resource contention scenarios of a cluster are as follows:
Users can use capacity scheduler of ResourceManager to set the task priority in Yarn because the task priority is implemented by the capacity scheduler of ResourceManager.
Set the mapreduce.job.priority parameter and use CLI or API to set the task priority.
When submitting tasks, add the -Dmapreduce.job.priority=<priority> parameter.
<priority> can be set to any of the following values:
You can also set the task priority through the API.
Set Configuration.set("mapreduce.job.priority", <priority>) or Job.setPriority(JobPriority priority).