-
Notifications
You must be signed in to change notification settings - Fork 233
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
[RawKV] support checksum #519
Conversation
Signed-off-by: haojinming <jinming.hao@pingcap.com>
Signed-off-by: haojinming <jinming.hao@pingcap.com>
rawkv/rawkv.go
Outdated
// (startKey, endKey], you can write: | ||
// `Scan(ctx, push(startKey, '\0'), push(endKey, '\0'), limit)`. | ||
func (c *Client) Checksum(ctx context.Context, startKey, endKey []byte, options ...RawOption, | ||
) (crc64Xor, totalKvs, totalBytes uint64, err error) { |
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.
Prefer to use a struct to wrap all these infos.
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.
Done, PTAL~
rawkv/rawkv.go
Outdated
// If you want to exclude the startKey or include the endKey, push a '\0' to the key. For example, to scan | ||
// (startKey, endKey], you can write: | ||
// `Scan(ctx, push(startKey, '\0'), push(endKey, '\0'), limit)`. |
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.
Seem it's the comments from Scan
.
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.
yes, they accept the same input parameters and has same constraint.
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.
// If you want to exclude the startKey or include the endKey, push a '\0' to the key. For example, to scan | |
// (startKey, endKey], you can write: | |
// `Scan(ctx, push(startKey, '\0'), push(endKey, '\0'), limit)`. | |
// Checksum do checksum of continuous kv pairs in range [startKey, endKey). | |
// If endKey is empty, it means unbounded. | |
// If you want to exclude the startKey or include the endKey, push a '\0' to the key. For example, to checksum | |
// (startKey, endKey], you can write: | |
// `Checksum(ctx, push(startKey, '\0'), push(endKey, '\0'), limit)`. |
Signed-off-by: haojinming <jinming.hao@pingcap.com>
Signed-off-by: haojinming <jinming.hao@pingcap.com>
Signed-off-by: haojinming jinming.hao@pingcap.com
Support
checksum
in rawkv.Client.Fix issue #518