terrytlu opened a new pull request, #8493: URL: https://github.com/apache/hbase/pull/8493
## Summary Backport of #6947 to branch-2.6. When Spark reads an HBase snapshot via `TableSnapshotInputFormat`, `InputSplit.getLength()` always returned 0. This caused the distributed computation framework (e.g. Spark) to treat all splits as empty and skip processing, resulting in no data or bogus data being read. This change calculates the per-region size via the new `SnapshotRegionSizeCalculator` and sets the `InputSplit` length accordingly, so the framework can correctly schedule and process the splits. ## Changes - Added `RegionSizes` and `SnapshotRegionSizeCalculator` classes. - `SnapshotInfo` now accumulates per-region sizes during manifest scanning. - `TableSnapshotInputFormatImpl.InputSplit` carries a `length` field, serialized in `write`/`readFields`. - Added `TestSnapshotRegionSizeCalculator`. ## Branch-specific note On this stable branch the `@Deprecated` `TableSnapshotRegionSplit` constructors (using HTableDescriptor/`HRegionInfo`) are **retained** for API compatibility. They are only removed on master (4.0.0). ## Tests - `mvn test -pl hbase-server -Dtest=TestSnapshotRegionSizeCalculator` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
