{"record":{"id":"cc902813a9169ecd","repo":"apache/hadoop","slug":"codec-name-policy-getcodecname-is-not-s","errorCode":null,"errorMessage":"\"Codec name \" + policy.getCodecName() + \" is not supported\"","messagePattern":"\"Codec name \" \\+ policy\\.getCodecName\\(\\) \\+ \" is not supported\"","errorType":"exception","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java","lineNumber":304,"sourceCode":"   */\n  public void clear() {\n    // TODO: we should only clear policies loaded from NN metadata.\n    // This is a placeholder for HDFS-7337.\n  }\n\n  /**\n   * Add an erasure coding policy.\n   * @return the added policy\n   */\n  public synchronized ErasureCodingPolicy addPolicy(\n      ErasureCodingPolicy policy) {\n    if (!userDefinedAllowed) {\n      throw new HadoopIllegalArgumentException(\n          \"Addition of user defined erasure coding policy is disabled.\");\n    }\n\n    if (!CodecUtil.hasCodec(policy.getCodecName())) {\n      throw new HadoopIllegalArgumentException(\"Codec name \"\n          + policy.getCodecName() + \" is not supported\");\n    }\n\n    int blocksInGroup = policy.getNumDataUnits() + policy.getNumParityUnits();\n    if (blocksInGroup > HdfsServerConstants.MAX_BLOCKS_IN_GROUP) {\n      throw new HadoopIllegalArgumentException(\"Number of data and parity blocks in an EC group \" +\n          blocksInGroup + \" should not exceed maximum \" + HdfsServerConstants.MAX_BLOCKS_IN_GROUP);\n    }\n\n    if (policy.getCellSize() > maxCellSize) {\n      throw new HadoopIllegalArgumentException(\"Cell size \" +\n          policy.getCellSize() + \" should not exceed maximum \" +\n          maxCellSize + \" bytes\");\n    }\n\n    String assignedNewName = ErasureCodingPolicy.composePolicyName(\n        policy.getSchema(), policy.getCellSize());\n    for (ErasureCodingPolicyInfo info : getPolicies()) {","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/ErasureCodingPolicyManager.java#L286-L322","documentation":"Error \"\"Codec name \" + policy.getCodecName() + \" is not supported\"\" thrown in apache/hadoop.","triggerScenarios":"Adding a custom erasure coding policy whose codec name is not one of the codecs supported by the HDFS erasure coding subsystem.","commonSituations":"See trigger scenarios.","solutions":["Use a codec supported by the chosen erasure coding schema (e.g. the default RS codec).","List available codecs via 'hdfs ec -listCodecs' and pick a supported one.","Implement/register the codec through the Hadoop codec registry if a custom codec is required."],"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-23T01:17:44.959Z"}