{"record":{"id":"95aff2d06c566718","repo":"apache/hadoop","slug":"invalid-numdataunits-and-numparityunits","errorCode":null,"errorMessage":"Invalid numDataUnits and numParityUnits","messagePattern":"Invalid numDataUnits and numParityUnits","errorType":"exception","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSLegacyRawDecoder.java","lineNumber":46,"sourceCode":"/**\n * A raw erasure decoder in RS code scheme in pure Java in case native one\n * isn't available in some environment. Please always use native implementations\n * when possible.\n *\n * Currently this implementation will compute and decode not to read units\n * unnecessarily due to the underlying implementation limit in GF. This will be\n * addressed in HADOOP-11871.\n */\n@InterfaceAudience.Private\npublic class RSLegacyRawDecoder extends RawErasureDecoder {\n  // To describe and calculate the needed Vandermonde matrix\n  private int[] errSignature;\n  private int[] primitivePower;\n\n  public RSLegacyRawDecoder(ErasureCoderOptions coderOptions) {\n    super(coderOptions);\n    if (getNumAllUnits() >= RSUtil.GF.getFieldSize()) {\n      throw new HadoopIllegalArgumentException(\n              \"Invalid numDataUnits and numParityUnits\");\n    }\n\n    this.errSignature = new int[getNumParityUnits()];\n    this.primitivePower = RSUtil.getPrimitivePower(getNumDataUnits(),\n        getNumParityUnits());\n  }\n\n  @Override\n  public void decode(ByteBuffer[] inputs, int[] erasedIndexes,\n                     ByteBuffer[] outputs) throws IOException {\n    // Make copies avoiding affecting original ones;\n    ByteBuffer[] newInputs = new ByteBuffer[inputs.length];\n    int[] newErasedIndexes = new int[erasedIndexes.length];\n    ByteBuffer[] newOutputs = new ByteBuffer[outputs.length];\n\n    // Adjust the order to match with underlying requirements.\n    adjustOrder(inputs, newInputs,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSLegacyRawDecoder.java#L28-L64","documentation":"Error \"Invalid numDataUnits and numParityUnits\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/erasurecode/rawcoder/RSLegacyRawDecoder.java:46 when the library encounters an invalid state.","commonSituations":"Occurs when RSLegacyRawDecoder is created with invalid numDataUnits/numParityUnits values. Use supported values (e.g., 6+3) for the legacy RS codec.","solutions":["Use valid RS legacy parameters (e.g. 6 data + 3 parity units); check the codec configuration for unsupported unit counts."],"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"}