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

Allow the normalize limit to be set via a flag. #3467

Merged
merged 3 commits into from
May 30, 2019

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented May 24, 2019

Fixes #3335


This change is Reviewable

@martinmr martinmr requested review from manishrjain and a team as code owners May 24, 2019 19:48
Copy link
Contributor

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

LGTM. Running CI again, tests seem to fail.

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: One comment. Use flag.Int instead of flag.Uint64. After fixing, feel free to merge.

Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @martinmr)


query/outputnode.go, line 281 at r1 (raw file):

		for _, ca := range child {
			cnt += len(pa) + len(ca)
			if cnt > int(x.Config.NormalizeNodeLimit) {

Can't you use flag.Int instead of using flag.Uint64 then casting it into int?

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, 1 unresolved discussion (waiting on @manishrjain)


query/outputnode.go, line 281 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Can't you use flag.Int instead of using flag.Uint64 then casting it into int?

I kept the flag as a uint to prevent someone from setting it to a negative value but I made NormalizeNodeLimit an int so the casting from uint to int is only done once.

@martinmr martinmr merged commit d1c1a50 into master May 30, 2019
@martinmr martinmr deleted the martinmr/normalize-limit-flag branch May 30, 2019 20:22
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
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.

Make normalizeLimit configurable instead of hard-coded
3 participants