{"record":{"id":"65bc4ba743599efd","repo":"apache/hadoop","slug":"compression-codec-name-was-not-found","errorCode":null,"errorMessage":"Compression codec {name} was not found.","messagePattern":"Compression codec (.+?) was not found\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobConf.java","lineNumber":815,"sourceCode":"  }\n  \n  /**\n   * Get the {@link CompressionCodec} for compressing the map outputs.\n   * \n   * @param defaultValue the {@link CompressionCodec} to return if not set\n   * @return the {@link CompressionCodec} class that should be used to compress the \n   *         map outputs.\n   * @throws IllegalArgumentException if the class was specified, but not found\n   */\n  public Class<? extends CompressionCodec> \n  getMapOutputCompressorClass(Class<? extends CompressionCodec> defaultValue) {\n    Class<? extends CompressionCodec> codecClass = defaultValue;\n    String name = get(JobContext.MAP_OUTPUT_COMPRESS_CODEC);\n    if (name != null) {\n      try {\n        codecClass = getClassByName(name).asSubclass(CompressionCodec.class);\n      } catch (ClassNotFoundException e) {\n        throw new IllegalArgumentException(\"Compression codec \" + name + \n                                           \" was not found.\", e);\n      }\n    }\n    return codecClass;\n  }\n  \n  /**\n   * Get the key class for the map output data. If it is not set, use the\n   * (final) output key class. This allows the map output key class to be\n   * different than the final output key class.\n   *  \n   * @return the map output key class.\n   */\n  public Class<?> getMapOutputKeyClass() {\n    Class<?> retv = getClass(JobContext.MAP_OUTPUT_KEY_CLASS, null, Object.class);\n    if (retv == null) {\n      retv = getOutputKeyClass();\n    }","sourceCodeStart":797,"sourceCodeEnd":833,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobConf.java#L797-L833","documentation":"Error \"Compression codec {name} was not found.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobConf.java:815 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the compression codec property to a class available on the classpath (e.g. org.apache.hadoop.io.compress.GzipCodec) or add the jar containing the codec."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}