Class ExternalStatsCapture
record(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>) with one flat _stats.* map per contribution; whichever operator drove the
iteration binds a sink ahead of time so the contributions end up on the operator's Status
and ride back to the coordinator via DriverCompletionInfo.
In the orthogonal stripe model the READER owns stripe addressing: it attributes each record to its
canonical stripe (ordinal = floor(recordStartOffset / stripeSize), using the base offset and
grid passed via FormatReadContext) and emits one record(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>) call per stripe it touched,
each map already carrying the _stats.stripe_* addressing keys. This sink no longer stamps
coverage — there is nothing for the coordinator to add, because only the reader knows where each
record sits relative to the grid.
Sinks must be bound on the same thread that subsequently invokes the reader's
close(). For the synchronous operator the operator owns the iteration thread; for the async
path the coordinator binds on the reader/worker thread that runs the iterator.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalStatsCapture.HandleBindssinkas the active capture target on the current thread; returns a handle the caller must close (try-with-resources) to restore the previous sink.newSink()Convenience factory for a fresh thread-safe sink.static voidAppends a flat_stats.*contribution forfilePath.
-
Method Details
-
record
Appends a flat_stats.*contribution forfilePath. Multiple contributions per path accumulate (one per stripe a chunk touched, one per whole-file read); the coordinator-side reconciler routes them by their marker keys. No-op if no sink is bound on the current thread, if the path isnull, or if the map isnull/empty.The sink is typed as
ConcurrentMapbecause parallel-parsing workers concurrently invokecomputeIfAbsenton the outer map; only theConcurrentMapcontract makes that lookup-or-insert atomic. -
bind
Bindssinkas the active capture target on the current thread; returns a handle the caller must close (try-with-resources) to restore the previous sink. The same sink instance can also be polled directly by the binding owner —record(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>)only writes. -
newSink
Convenience factory for a fresh thread-safe sink.
-