Repository navigation
kvs: apply C++ idiom and class layout rules - #566
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
Documentation preview for this pull request is available at: |
0de5fe2 to
afded22
Compare
afded22 to
ec3feca
Compare
ec3feca to
e086807
Compare
| return total_size; | ||
| } | ||
|
|
||
| score::Result<void> Kvs::write_temp_file(const score::filesystem::Path& path, |
There was a problem hiding this comment.
[non blocking] when you refactor function keep it in same location , do not update function adn change it's location in oneshot that makes review not easy.
There was a problem hiding this comment.
It's not random, it's part of the change.
- Order class sections and members as the style guide requires.
| return {}; | ||
| } | ||
|
|
||
| score::Result<score::filesystem::Path> Kvs::KvsFilePath(const SnapshotId& snapshot_id) const noexcept |
There was a problem hiding this comment.
this function returns file name and old name was get_kvs_filename why did you change it ??
There was a problem hiding this comment.
- Alignment with Rust implementation.
- No rules on that in the guidelines.
- It's not really a getter, as those methods construct the path.
There was a problem hiding this comment.
this function returns file name , not file path , i would recommend to adjust rust name instead of c++ name to misleading name
There was a problem hiding this comment.
Both KvsFilePath and HashFilePath work the same way.
Functions return file paths, that are created by taking filename_prefix_, then appending snapshot ID, then extension.
If such file doesn't exist, then an error is returned.
filename_prefix_ is set in Kvs::Open, and it's a working directory with kvs_, instance ID and a _ appended.
With Rust there are two separate methods: *_file_path and *_file_name.
*_file_pathreturns full path (working dir + file name).*_file_namereturns file name (sokvs_<instance_id>_<snapshot_id>.<extension>.
| } | ||
|
|
||
| for (const char* extension : file_extensions) | ||
| score::Result<score::filesystem::Path> Kvs::HashFilePath(const SnapshotId& snapshot_id) const noexcept |
There was a problem hiding this comment.
why did you rename it form get_hash_filename to HathFilePath ??
There was a problem hiding this comment.
- Alignment with Rust implementation.
- No rules on that in the guidelines.
- It's not really a getter, as those methods construct the path.
There was a problem hiding this comment.
again , this function returns hash file name not full path .
e086807 to
5179e8f
Compare
- Brace-initialize declarations. Count/value constructors and initializer_list types keep parentheses. - Declare one variable per declaration. - Order class sections and members as the style guide requires. Move the KvsValue::ValueVariant alias next to Array and Object. - Initialize InstanceId, SnapshotId and KvsValue members in the initializer list. - Define members in .cpp files in declaration order and group file-local helpers at the top. - Name repeated file suffixes and the hash size. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5179e8f to
980a361
Compare
Merge #564 first.
Relates to #556