merlimat opened a new pull request, #25701:
URL: https://github.com/apache/pulsar/pull/25701

   ## Summary
   
   Adds `MetadataStore.scanChildren(parentPath, ScanConsumer consumer)` — the 
value-bearing counterpart to `getChildren`. Same hierarchy semantics (direct 
children only, no descendants), but each record carries the value and `Stat` 
alongside the path.
   
   Results are delivered to a `ScanConsumer` via `onNext` / `onError` / 
`onCompleted` so a large result set is never materialized as a single in-memory 
`List`.
   
   ### Default implementation
   
   `getChildrenFromStore(parent)` + sequential `storeGet` per child. Used by 
ZooKeeper / MockZooKeeper. One round trip per child.
   
   ### Native overrides
   
   - `LocalMemoryMetadataStore` — `NavigableMap.subMap` with a direct-child 
filter.
   - `RocksdbMetadataStore` — `RocksIterator.seek` over the parent's prefix.
   - `OxiaMetadataStore` — `client.rangeScan` over `[parent + "/", parent + 
"//")`, the same convention `getChildrenFromStore` uses with `client.list`.
   
   ### Wrappers
   
   - `DualMetadataStore` routes by migration phase.
   - `FaultInjectionMetadataStore` adds `OperationType.SCAN_CHILDREN` for fault 
injection.
   
   ### Motivation
   
   Sub-PIP groundwork for 
[PIP-471](https://github.com/apache/pulsar/pull/25693): the metadata-driven 
transaction components need to stream the children of a parent path together 
with their values (to enumerate ops for a transaction, ack records for a 
subscription, etc.) without paying for repeated round trips or for accumulating 
large result lists in broker memory.
   
   Cache integration is a separate follow-up — sits more naturally on 
`MetadataCache<T>` (typed) than on `MetadataStore` (raw bytes).
   
   ## Test plan
   
   - [x] `./gradlew :pulsar-metadata:test --tests 
"org.apache.pulsar.metadata.MetadataStoreScanChildrenTest"` — 4 cases × 5 
backends (ZooKeeper, Memory, RocksDB, Oxia, MockZooKeeper) = 20 invocations, 
all passing.
   - [x] Existing `pulsar-metadata` tests still pass.


-- 
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]

Reply via email to