zhangxinyao88 opened a new pull request, #11057: URL: https://github.com/apache/arrow-rs/pull/11057
# Which issue does this PR close? - Closes #11028. # Rationale for this change `ParquetMetaData::memory_size()` currently accounts for page-index memory only when the provider is the built-in `PageIndex`. Custom `PageIndexProvider` implementations are therefore reported as zero even when they own cached index data. # What changes are included in this PR? - Add a default `PageIndexProvider::heap_size() -> usize` method returning zero. - Have the built-in `PageIndex` delegate to its existing private `HeapSize` implementation. - Account for the concrete provider size, `Arc` allocation overhead, and provider-reported heap allocation in `ParquetMetaData::memory_size()`. - Add regression coverage for a custom provider that reports heap usage. # Are these changes tested? - `cargo test -p parquet file::metadata --no-default-features` - `cargo check -p parquet --example custom_page_index --no-default-features --features arrow` - `rustfmt --check` on modified files. This change was developed with AI assistance. I reviewed the implementation and verified the built-in accounting path, the custom-provider regression test, and source compatibility for the existing custom-provider example. # Are there any user-facing changes? Yes. Custom `PageIndexProvider` implementations can opt into `ParquetMetaData::memory_size()` accounting by overriding `heap_size()`. Existing implementations remain source-compatible and report zero additional heap usage by default. -- 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]
