{"record":{"id":"a467b72a3dc47507","repo":"apache/hadoop","slug":"blockindex-d-numblocks-d","errorCode":null,"errorMessage":"blockIndex=%d, numBlocks=%d","messagePattern":"blockIndex=(.+?), numBlocks=(.+?)","errorType":"exception","errorClass":"IndexOutOfBoundsException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/BCFile.java","lineNumber":722,"sourceCode":"      if (imeBCIndex == null) {\n        throw new MetaBlockDoesNotExist(\"name=\" + name);\n      }\n\n      BlockRegion region = imeBCIndex.getRegion();\n      return createReader(imeBCIndex.getCompressionAlgorithm(), region);\n    }\n\n    /**\n     * Stream access to a Data Block.\n     * \n     * @param blockIndex\n     *          0-based data block index.\n     * @return BlockReader input stream for reading the data block.\n     * @throws IOException\n     */\n    public BlockReader getDataBlock(int blockIndex) throws IOException {\n      if (blockIndex < 0 || blockIndex >= getBlockCount()) {\n        throw new IndexOutOfBoundsException(String.format(\n            \"blockIndex=%d, numBlocks=%d\", blockIndex, getBlockCount()));\n      }\n\n      BlockRegion region = dataIndex.getBlockRegionList().get(blockIndex);\n      return createReader(dataIndex.getDefaultCompressionAlgorithm(), region);\n    }\n\n    private BlockReader createReader(Algorithm compressAlgo, BlockRegion region)\n        throws IOException {\n      RBlockState rbs = new RBlockState(compressAlgo, in, region, conf);\n      return new BlockReader(rbs);\n    }\n\n    /**\n     * Find the smallest Block index whose starting offset is greater than or\n     * equal to the specified offset.\n     * \n     * @param offset","sourceCodeStart":704,"sourceCodeEnd":740,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/BCFile.java#L704-L740","documentation":"Error \"blockIndex=%d, numBlocks=%d\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/file/tfile/BCFile.java:722 when the library encounters an invalid state.","commonSituations":"Occurs when requesting a block index outside the valid range of blocks. Validate blockIndex against the block count before seeking.","solutions":["The block index is out of range; the file is truncated or corrupt. Re-create the TFile/BCFile."],"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"}