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

util/chunk: add List to holds a slice of Chunk. #5290

Merged
merged 4 commits into from Dec 4, 2017

Conversation

coocood
Copy link
Member

@coocood coocood commented Dec 2, 2017

Used to properly handle max chunk size when appending row.

Used to properly handle max chunk size when appending row.
@coocood
Copy link
Member Author

coocood commented Dec 2, 2017

@zz-jason @XuHuaiyu PTAL

@iamxy
Copy link
Member

iamxy commented Dec 2, 2017

/rebuild

)

// List holds a slice of chunks, use to append rows with max chunk size properly handled.
type List struct {
Copy link
Member

Choose a reason for hiding this comment

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

In what scenario should we use this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sort and TopN can use it to simplify the logic.
And the IndexLookUpJoin need it too because we need index batch size greater than max chunk size.

Copy link
Member

Choose a reason for hiding this comment

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

why not use container/list ?

@zz-jason
Copy link
Member

zz-jason commented Dec 4, 2017

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 4, 2017
}
c.Assert(l.NumChunks(), check.Equals, 3)
c.Assert(l.Len(), check.Equals, 5)

Copy link
Contributor

Choose a reason for hiding this comment

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

check len(l.freelist) == 0 here
rest LGTM

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 4, 2017
@coocood coocood merged commit 7e0827f into pingcap:master Dec 4, 2017
@coocood coocood deleted the chunk-list branch December 4, 2017 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants