{"record":{"id":"0aabc2dacdde1de1","repo":"apache/hadoop","slug":"changing-job-priority-in-localjobrunner-is-not-sup","errorCode":null,"errorMessage":"Changing job priority in LocalJobRunner is not supported.","messagePattern":"Changing job priority in LocalJobRunner is not supported\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalJobRunner.java","lineNumber":807,"sourceCode":"  }\n\n  public org.apache.hadoop.mapreduce.JobStatus submitJob(\n      org.apache.hadoop.mapreduce.JobID jobid, String jobSubmitDir,\n      Credentials credentials) throws IOException {\n    Job job = new Job(JobID.downgrade(jobid), jobSubmitDir);\n    job.job.setCredentials(credentials);\n    return job.status;\n\n  }\n\n  public void killJob(org.apache.hadoop.mapreduce.JobID id) {\n    jobs.get(JobID.downgrade(id)).killed = true;\n    jobs.get(JobID.downgrade(id)).interrupt();\n  }\n\n  public void setJobPriority(org.apache.hadoop.mapreduce.JobID id,\n      String jp) throws IOException {\n    throw new UnsupportedOperationException(\"Changing job priority \" +\n                      \"in LocalJobRunner is not supported.\");\n  }\n  \n  /** Throws {@link UnsupportedOperationException} */\n  public boolean killTask(org.apache.hadoop.mapreduce.TaskAttemptID taskId,\n      boolean shouldFail) throws IOException {\n    throw new UnsupportedOperationException(\"Killing tasks in \" +\n    \"LocalJobRunner is not supported\");\n  }\n\n  public org.apache.hadoop.mapreduce.TaskReport[] getTaskReports(\n      org.apache.hadoop.mapreduce.JobID id, TaskType type) {\n    return new org.apache.hadoop.mapreduce.TaskReport[0];\n  }\n\n  public org.apache.hadoop.mapreduce.JobStatus getJobStatus(\n      org.apache.hadoop.mapreduce.JobID id) {\n    Job job = jobs.get(JobID.downgrade(id));","sourceCodeStart":789,"sourceCodeEnd":825,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapred/LocalJobRunner.java#L789-L825","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\njob.setPriority(JobPriority.HIGH); // throws in local mode\n\n// after\nif (!\"local\".equals(conf.get(MRJobConfig.FRAMEWORK_NAME, \"local\"))) {\n  job.setPriority(JobPriority.HIGH);\n}","handlingStrategy":"validation","validationCode":"boolean isLocal = \"local\".equals(\n    conf.get(MRJobConfig.FRAMEWORK_NAME, MRJobConfig.FRAMEWORK_LOCAL_NAME));\nif (!isLocal) { job.setPriority(JobPriority.HIGH); }","typeGuard":null,"tryCatchPattern":"try {\n  job.setPriority(JobPriority.HIGH);\n} catch (UnsupportedOperationException e) {\n  LOG.warn(\"Job priority not supported by this framework (local mode?): {}\", e.getMessage());\n}","preventionTips":["Check mapreduce.framework.name before calling cluster-only admin APIs","Keep job-control code paths separate for local tests vs cluster runs"],"tags":["hadoop","mapreduce","local-mode","job-priority","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}