apache/hadoop · error · UnsupportedOperationException
Changing job priority in LocalJobRunner is not supported.
Error message
Changing job priority in LocalJobRunner is not supported.
What it means
LocalJobRunner is the in-process engine used when mapreduce.framework.name=local. Its ClientProtocol implementation of setJobPriority(JobID, String) unconditionally throws UnsupportedOperationException because local mode has no scheduler, queues, or preemption model where priority could have any effect. Only the YARN (or classic) cluster path honors priority. The job itself keeps running; only the control call fails.
Source
Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalJobRunner.java:807
}
public org.apache.hadoop.mapreduce.JobStatus submitJob(
org.apache.hadoop.mapreduce.JobID jobid, String jobSubmitDir,
Credentials credentials) throws IOException {
Job job = new Job(JobID.downgrade(jobid), jobSubmitDir);
job.job.setCredentials(credentials);
return job.status;
}
public void killJob(org.apache.hadoop.mapreduce.JobID id) {
jobs.get(JobID.downgrade(id)).killed = true;
jobs.get(JobID.downgrade(id)).interrupt();
}
public void setJobPriority(org.apache.hadoop.mapreduce.JobID id,
String jp) throws IOException {
throw new UnsupportedOperationException("Changing job priority " +
"in LocalJobRunner is not supported.");
}
/** Throws {@link UnsupportedOperationException} */
public boolean killTask(org.apache.hadoop.mapreduce.TaskAttemptID taskId,
boolean shouldFail) throws IOException {
throw new UnsupportedOperationException("Killing tasks in " +
"LocalJobRunner is not supported");
}
public org.apache.hadoop.mapreduce.TaskReport[] getTaskReports(
org.apache.hadoop.mapreduce.JobID id, TaskType type) {
return new org.apache.hadoop.mapreduce.TaskReport[0];
}
public org.apache.hadoop.mapreduce.JobStatus getJobStatus(
org.apache.hadoop.mapreduce.JobID id) {
Job job = jobs.get(JobID.downgrade(id));View on GitHub (pinned to 2add963021)
Solutions
- Guard the call: only set priority when mapreduce.framework.name is not 'local'
- If priority actually matters, submit to a YARN cluster (mapreduce.framework.name=yarn)
- Wrap the call in try/catch UnsupportedOperationException and log-and-continue when running locally
Example fix
// before
job.setPriority(JobPriority.HIGH); // throws in local mode
// after
if (!"local".equals(conf.get(MRJobConfig.FRAMEWORK_NAME, "local"))) {
job.setPriority(JobPriority.HIGH);
} Defensive patterns
Strategy: validation
Validate before calling
boolean isLocal = "local".equals(
conf.get(MRJobConfig.FRAMEWORK_NAME, MRJobConfig.FRAMEWORK_LOCAL_NAME));
if (!isLocal) { job.setPriority(JobPriority.HIGH); } Try / catch
try {
job.setPriority(JobPriority.HIGH);
} catch (UnsupportedOperationException e) {
LOG.warn("Job priority not supported by this framework (local mode?): {}", e.getMessage());
} Prevention
- Check mapreduce.framework.name before calling cluster-only admin APIs
- Keep job-control code paths separate for local tests vs cluster runs
When it happens
Trigger: Calling JobClient.setJobPriority(...), job.setPriority(JobPriority), or any tool that invokes ClientProtocol.setJobPriority (e.g. 'hadoop job -set-priority') while the job runs under mapreduce.framework.name=local (the default).
Common situations: Unit/integration tests that reuse production job-control code against LocalJobRunner; CLI scripts ported from a cluster to a developer machine; frameworks (Oozie actions, schedulers) that set priority unconditionally on every submission.
Related errors
- Killing tasks in LocalJobRunner is not supported
- Not supported
- Unrecognized priority: {}
- getShuffleFinishTime() not supported for MapTask
- setShuffleFinishTime() not supported for MapTask
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/0aabc2dacdde1de1.
Report an issue: GitHub.