clp-s: Add support for chunking output into different files during timestamp-ordered decompression#451
Merged
Conversation
wraymo
reviewed
Jun 20, 2024
wraymo
left a comment
Contributor
There was a problem hiding this comment.
Great work! Most of the comments are about the style changes.
Comment on lines
+84
to
+98
| auto finish_chunk = [&](bool open_new_writer) { | ||
| writer.close(); | ||
| std::string new_file_name = std::string(src_path) + "_" + std::to_string(first_timestamp) | ||
| + "_" + std::to_string(last_timestamp) + ".jsonl"; | ||
| auto new_file_path = std::filesystem::path(new_file_name); | ||
| std::error_code ec; | ||
| std::filesystem::rename(src_path, new_file_path, ec); | ||
| if (ec) { | ||
| throw OperationFailed(ErrorCodeFailure, __FILE__, __LINE__, ec.message()); | ||
| } | ||
|
|
||
| if (open_new_writer) { | ||
| writer.open(src_path, FileWriter::OpenMode::CreateForWriting); | ||
| } | ||
| }; |
Contributor
There was a problem hiding this comment.
Do you have any concerns of making it a private method?
Contributor
Author
There was a problem hiding this comment.
I think it's easier to read this way, but if you prefer private method I can change it.
| po::value<size_t>(&m_ordered_chunk_split_threshold) | ||
| ->default_value(m_ordered_chunk_split_threshold), | ||
| "Number of records to include in each output chunk when decompressing records " | ||
| "in order" |
Contributor
There was a problem hiding this comment.
Suggested change
| "in order" | |
| "in timestamp ascending order" |
Contributor
Author
There was a problem hiding this comment.
I replaced with "in ascending timestamp order" instead.
Co-authored-by: wraymo <37269683+wraymo@users.noreply.github.com>
wraymo
reviewed
Jun 21, 2024
| po::bool_switch(&m_ordered_decompression), | ||
| "Enable decompression in ascending timestamp order for this archive" | ||
| )( | ||
| "ordered-chunk-split-threshold", |
Contributor
There was a problem hiding this comment.
Do you want to update the name of this argument?
wraymo
approved these changes
Jun 24, 2024
wraymo
left a comment
Contributor
There was a problem hiding this comment.
For the PR title, what about "clp-s: Add support for chunking output into different files during timestamp-ordered decompression"?
jackluo923
pushed a commit
to jackluo923/clp
that referenced
this pull request
Dec 4, 2024
…mestamp-ordered decompression (y-scope#451) Co-authored-by: wraymo <37269683+wraymo@users.noreply.github.com>
junhaoliao
pushed a commit
to junhaoliao/clp
that referenced
this pull request
May 17, 2026
…mestamp-ordered decompression (y-scope#451) Co-authored-by: wraymo <37269683+wraymo@users.noreply.github.com>
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.
Description
This PR adds support for chunking the output of timestamp-ordered decompression into several files, where each file has at most the number of records specified in the command line argument. The argument
--ordered-chunk-split-threshold <value>can be used in conjunction with the--orderedargument during decompression to trigger this feature.Validation performed