feat(pipeline): add Writer flush and dataset selection duration#183
Closed
feat(pipeline): add Writer flush and dataset selection duration#183
Conversation
…leWriter - Add optional flush(dataset) method to Writer interface for finalizing output after all stages complete - Replace per-write() N3Writer in FileWriter with a lazy per-dataset approach: a single N3Writer stays open across write() calls so Turtle prefixes are declared once and triples can be grouped by subject - Add prefixes option to FileWriterOptions, passed through to N3Writer - Propagate flush() through FanOutWriter and TransformWriter - Call flush() in Pipeline.processDataset() after stages, before datasetComplete - Add tests for prefix output, single-prefix-block across writes, flush-without-write no-op, and per-dataset flush calls in Pipeline
- Add `duration` parameter to `ProgressReporter.datasetsSelected()` - Measure selection time in `Pipeline.run()` and call `datasetsSelected()` - Display duration in `ConsoleReporter` using `prettyMilliseconds()`
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
flush()lifecycle method toWriterinterface, called after all stages for a dataset completeFileWriter: when format isturtle, automatically writes@prefixdeclarations at the top of output filesPipeline.run()and report it viaProgressReporter.datasetsSelected()ConsoleReporterusingprettyMilliseconds()Test plan
npx nx run-many -t typecheck -p pipeline pipeline-console-reporterpassesnpx nx run-many -t test -p pipeline pipeline-console-reporterpasses (161 + 1 tests)npx nx run-many -t lint -p pipeline pipeline-console-reporterpasses