-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: let stable meta using protobuf format #9054
Conversation
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Manual Test: set |
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest LGTM
Signed-off-by: Lloyd-Pottiger <[email protected]>
if (STORAGE_FORMAT_CURRENT.stable == StableFormat::V1) | ||
{ | ||
writeIntBinary(valid_rows, buf); | ||
writeIntBinary(valid_bytes, buf); | ||
writeIntBinary(static_cast<UInt64>(files.size()), buf); | ||
for (const auto & f : files) | ||
writeIntBinary(f->pageId(), buf); | ||
} | ||
else if (STORAGE_FORMAT_CURRENT.stable == StableFormat::V2) | ||
{ | ||
dtpb::StableLayerMeta meta; | ||
meta.set_valid_rows(valid_rows); | ||
meta.set_valid_bytes(valid_bytes); | ||
for (const auto & f : files) | ||
meta.add_files()->set_page_id(f->pageId()); | ||
|
||
auto data = meta.SerializeAsString(); | ||
writeStringBinary(data, buf); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put if (likely(STORAGE_FORMAT_CURRENT.stable == StableFormat::V2))
in the first check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current use v1, so if (likely(STORAGE_FORMAT_CURRENT.stable == StableFormat::V1))
Signed-off-by: Lloyd-Pottiger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Signed-off-by: Lloyd-Pottiger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tiny optional changes.
return buf.count(); | ||
} | ||
|
||
namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this dummy namespace a typo?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: breezewish, JaySon-Huang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/hold |
Signed-off-by: Lloyd-Pottiger <[email protected]>
/unhold |
} | ||
else | ||
{ | ||
throw Exception("Unexpected version: {}", STORAGE_FORMAT_CURRENT.stable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected version: {}", STORAGE_FORMAT_CURRENT.stable);
else if (version == StableFormat::V2) | ||
return derializeMetaV2FromBuf(buf); | ||
else | ||
throw Exception("Unexpected version: {}", version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected version: {}", version);
@JaySon-Huang: GitHub didn't allow me to request PR reviews from the following users: Lloyd-Pottiger. Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What problem does this PR solve?
Issue Number: ref #9036
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note