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

When looking up a key, print if it's a multi-part list and its splits. #3311

Merged
merged 2 commits into from
Apr 23, 2019

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Apr 23, 2019

This change is Reviewable

@martinmr martinmr requested a review from a team April 23, 2019 01:08
Copy link
Contributor

@codexnull codexnull left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm: Got comments. Address those before merging.

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @martinmr)


dgraph/cmd/debug/run.go, line 448 at r1 (raw file):

	isMultiPart := pl.IsMultiPart()
	fmt.Fprintf(&buf, " Is multipart list?: %v\n", isMultiPart)

Not both question mark and colon.


dgraph/cmd/debug/run.go, line 450 at r1 (raw file):

	fmt.Fprintf(&buf, " Is multipart list?: %v\n", isMultiPart)
	if isMultiPart {
		fmt.Fprintf(&buf, " Start UIDs of each part: %v\n", pl.PartSplits())

"Start UID for part: %d\n"


posting/list.go, line 1324 at r1 (raw file):

// IsMultiPart returns true if the list has been split into multiple parts.
func (l *List) IsMultiPart() bool {

Do you need this bool? The PartSplits can just deal with this already.


posting/list.go, line 1332 at r1 (raw file):

func (l *List) PartSplits() []uint64 {
	if len(l.plist.Splits) == 0 {
		return nil

Not sure why this if is relevant. In fact, you might want to do a slice copy instead.

Copy link
Contributor

@danielmai danielmai left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @martinmr)


posting/list.go, line 1329 at r1 (raw file):

// PartSplits returns an empty array if the list has not been split into multiple parts.
// Otherwise, it returns an array  containing the start UID of each part.

nit: extra space

Copy link
Contributor Author

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @manishrjain)


dgraph/cmd/debug/run.go, line 448 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Not both question mark and colon.

Done.


dgraph/cmd/debug/run.go, line 450 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

"Start UID for part: %d\n"

Done.


posting/list.go, line 1324 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Do you need this bool? The PartSplits can just deal with this already.

Done.


posting/list.go, line 1332 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Not sure why this if is relevant. In fact, you might want to do a slice copy instead.

Done.

@martinmr martinmr merged commit b1d750b into master Apr 23, 2019
@martinmr martinmr deleted the martinmr/debug-startuid branch April 23, 2019 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants