Skip to content
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

Merged
merged 6 commits into from
Jun 22, 2022
Merged

[RawKV] support checksum #519

merged 6 commits into from
Jun 22, 2022

Conversation

haojinming
Copy link
Contributor

Signed-off-by: haojinming jinming.hao@pingcap.com
Support checksum in rawkv.Client.
Fix issue #518

Signed-off-by: haojinming <jinming.hao@pingcap.com>
@haojinming haojinming changed the title support checksum [RawKV] support checksum Jun 2, 2022
Signed-off-by: haojinming <jinming.hao@pingcap.com>
@iosmanthus iosmanthus self-requested a review June 2, 2022 08:39
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) {
Copy link
Member

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.

Copy link
Contributor Author

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
Comment on lines 509 to 511
// 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)`.
Copy link
Member

@iosmanthus iosmanthus Jun 2, 2022

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.

Copy link
Contributor Author

@haojinming haojinming Jun 2, 2022

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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)`.

haojinming and others added 3 commits June 10, 2022 11:37
Signed-off-by: haojinming <jinming.hao@pingcap.com>
Signed-off-by: haojinming <jinming.hao@pingcap.com>
@disksing disksing merged commit 681fb6e into tikv:master Jun 22, 2022
@haojinming haojinming deleted the raw_checksum branch June 22, 2022 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants