flight_service: add TrailingFlightDataStream #157
Merged
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.
This new type of streams allows you to "chain" streams together. This will be used to "chain" FlightData
containing metrics to the stream corresponding to the last executed partition in a task.
Streams already offer a
chain()API but it lacks a feature we need - a callback to decide whetheror not to collect and append metrics.
When a stream is complete, as a part of the proposed metrics protocol, the ArrowFlightEndpoint needs to check if
this is the last stream/partition. This synchronization point between N streams for N partitions will
have to be managed in some shared state between the stream and the ArrowFlightEndpoint. In this callback, we
can check if this is the last partition. If so, we can collect metrics and send them in the trailing stream.
For more details, see the draft implementation here
One alternative option considered was to have the callback generate
FlightDatawhich can be sent onthe stream. Ultimately, it seemed cleaner to just return another stream.
Informs: #123