-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
respect format version during data read write (#221)
* Make VERSION significant Ref #220 This implementation is used for building the basic structure of binding the LogBatch `decoding` and `encoding` with `VERSION`. Briefly, it introduces the trait `Header` for `LogFileHeader`, and make relevant implementations in `LogFileWriter` and `LogFileReader`. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Replace the return of `build_file_header` with `Result<>` Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Reconstruct the arrangement of `FileCollection` in `pipe.rs` This commit has reconstructed the handles in `FileCollection`, replaced with `FileHandler` which comprised of `F::Handle` and `Version`. This implementation is meaningful both for binding the `Version` to each file and reducing unnecessary `LogFileHeader` loading in several `READ` cases. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Tidy the supplementary annotations. According to the guidline of standard `fmt --check` tool, supplementary annotations are formatted in this commit. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Fix the unexpected `double-ref` error. The `double-ref` error in the processing of accessing the last one of `[FileHandler]` container was fixed. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Refine the implementation on `LogFileReader` according to comments. This commit has done the several modifications: >* Refine the implementation on `LogFileReader` >* Supplement extra uts for `LogFileReader` Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Minor modifications for compatibility. This commit includes several minor modifications and codes clean for compatibility. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Redesign the implementation on `recover_queue` for better performance and compatibility. Considering the compatibility to `VERSION` and good performance on `recovery`, the implementation on `recover_queue` is modified here. And compared with benchmark on `master`, the result of benchmark on current PR shows no performance regression. Configuration of my local environment for benchmark was listed as following: > * OS: MacOS - Monterey 12.1 > * Mem: 16GB > * CPU: Apple M1 Pro > * DISK: NVME SSD - APPLE SSD AP0512R By `cargo bench -- --bench benches`, the performance between `master` branch and current PR could be reviewed with the following details: >* `Master`: 108.99ms on `default` workload, 122.41ms on `compressed` workload, 994ms on `mini-batch(1kb)` workload, 2.2368s on `10GB` workload. >* current PR: 111.63ms on `default` workload, 116.35ms on `compressed` workload, 921.98ms on `mini-batch(1kb)` workload, 2.0905s on `10GB` workload. All the results are generated by `bench` on a same dataset, and the minor fluctuation on performance resulted by other processes. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Remove unnecessary codes and make the implementation related to `VERSION` more coherent. This commit has done the several works: >* Re-design the implementation on `recover_queue` to make it more coherent. >* Code clean-up on struct functions. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Minor modifications for better cohesion This commit includes: >* Redesgin the implementation on the building of `LogFileHeader`, marked as a `method` for `LogFileReader`; >* Modify the code-style in `pipe_builder.rs`; >* Replace the public `recover_queue`, relied on the calling of `get_mut_file_list`, with coherent implementation. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Code-style clean-up and supplements on testing. This commit do these things: >* Codes clean-up for better consistency on code-style; >* Supplement necessary testcases for meeting the standard on `codecov/path`; Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Codes clean-up. This commit does the followings: >* Remove stale annoatations; >* Integrate the code style of relevant codes in `pipe_builder.rs` and `log_file.rs`; Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Codes clean-up in log_file.rs. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> * Codes clean-up in log_file.rs. Signed-off-by: Lucasliang <nkcs_lykx@hotmail.com> Co-authored-by: Lucasliang <yangkexin.liang@pingcap.com> Co-authored-by: Xinye Tao <xy.tao@outlook.com>
- Loading branch information
1 parent
e15b9ec
commit 812a8c0
Showing
11 changed files
with
397 additions
and
119 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.