Wire VirtualPoolHandle stats from Rust via single FFM call#5
Open
Bukhtawar wants to merge 3 commits into
Open
Conversation
Signed-off-by: rayshrey <rayshrey@amazon.com>
…eAllocator
Introduce VirtualPoolHandle for Rust-side memory pools that track
allocations locally but report stats to the Java ArrowNativeAllocator
for a unified view. The Rust write/merge MemoryPool reports its
used/peak via FFM, and ArrowNativeAllocator.stats() returns all pools
(Java Arrow + Rust virtual) in a single NativeAllocatorPoolStats.
- VirtualPoolHandle: volatile used/peak, updated by Rust via FFM
- registerVirtualPool(name, limit): creates a virtual pool entry
- stats() now iterates both real pools and virtual pools
Usage:
VirtualPoolHandle writePool = allocator.registerVirtualPool("write", writeLimit);
// Rust periodically calls: writePool.updateStats(used, peak)
// stats() returns: {flight: ..., ingest: ..., query: ..., write: ...}
Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
- Add parquet_get_pool_stats FFM function that writes 6×i64 (write/merge used, peak, limit) in one native call - Add RustBridge.getPoolStats() Java-side wrapper using confined Arena - Register write/merge virtual pools in ParquetDataFormatPlugin and set a stats refresher callback that fetches Rust stats on demand - Make VirtualPoolHandle public so parquet plugin can access updateStats - Add setVirtualPoolStatsRefresher to ArrowNativeAllocator, called before stats() collects pool data - Add unit tests for virtual pool registration, stats update, refresher invocation, and unsupported-child enforcement
b4117dd to
20c7987
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parquet_get_pool_statsFFM function that returns write and merge pool stats (used, peak, limit) in a single native call instead of 6 separate FFM invocationsArrowNativeAllocatorduring plugin initialization, with a stats refresher callback that populates them on demand when_nodes/statsis calledVirtualPoolHandlepublic and addssetVirtualPoolStatsRefresherso the parquet plugin can wire the Rust→Java stats bridgeTest plan
ArrowNativeAllocatorTests)arrow-base+parquet-data-format)_nodes/statsendpoint showing write/merge pool stats