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

Make getUid global #16

Merged
merged 11 commits into from
Feb 3, 2016
Merged

Make getUid global #16

merged 11 commits into from
Feb 3, 2016

Conversation

ashwin95r
Copy link
Contributor

@ashwin95r ashwin95r commented Feb 1, 2016

Review on Reviewable

@CLAassistant
Copy link

CLA assistant check
All committers have accepted the CLA.

@manishrjain
Copy link
Contributor

Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, 5 unresolved discussions.


loader/loader.go, line 154 [r1] (raw file):
... % s.mod shouldn't always be zero. It should be the index set for the server.


loader/loader.go, line 158 [r1] (raw file):
No need for else after a continue.


loader/loader.go, line 163 [r1] (raw file):
Add a log here as well.


loader/loader.go, line 173 [r1] (raw file):
if len(nq.ObjectId) == 0 || farm.Fingerprint64([]byte(nq.ObjectId)) % s.mod != s.idx {


loader/loader.go, line 177 [r1] (raw file):
No need for else again.


Comments from the review on Reviewable.io

@manishrjain
Copy link
Contributor

Review status: 0 of 6 files reviewed at latest revision, 10 unresolved discussions.


loader/loader.go, line 158 [r1] (raw file):
So, continue is great for code readability. It avoids having to scan the rest of the code in the block to see if there's anything more. You should get rid of else instead; unless there's a particular reason you can't.


loader/loader.go, line 149 [r3] (raw file):
You got it wrong here, but I can see why... We should change the names of the variables to numInstances and instanceIdx.


loader/loader.go, line 169 [r3] (raw file):
Same problem here.


query/query.go, line 258 [r3] (raw file):
In a % b == c, mod generally refers to b, and c to index.


server/uidassigner/main.go, line 22 [r3] (raw file):
Call it instanceIdx, both in var and in the flag.


server/uidassigner/main.go, line 23 [r3] (raw file):
Call it numInstances


Comments from the review on Reviewable.io

@ashwin95r
Copy link
Contributor Author

Review status: 0 of 6 files reviewed at latest revision, 10 unresolved discussions.


loader/loader.go, line 149 [r3] (raw file):
Actually I named the machine index as mod and the total number of instances as numInstance. Maybe I should rename them to clear the confusion


Comments from the review on Reviewable.io

@manishrjain
Copy link
Contributor

loader/loader.go, line 149 [r3] (raw file):
Yeah, do that.


Comments from the review on Reviewable.io

@ashwin95r
Copy link
Contributor Author

Review status: 0 of 8 files reviewed at latest revision, 10 unresolved discussions.


loader/loader.go, line 158 [r1] (raw file):
Here, since we have to check if the subject and object can be assigned UID, we need two if statements and continue here would render the following if useless which isn't correct


Comments from the review on Reviewable.io

@manishrjain
Copy link
Contributor

Reviewed 5 of 6 files at r2, 1 of 1 files at r3.
Review status: 2 of 8 files reviewed at latest revision, 10 unresolved discussions.


loader/loader.go, line 158 [r1] (raw file):
This looks like a bit of repeated code between allocating for subject and objectid. Move it out into a function and reuse it.


loader/loader.go, line 50 [r4] (raw file):
numInstances -- plural; as I mentioned below as well.


query/query.go, line 258 [r4] (raw file):
Change the comment to use the updated variable names.


Comments from the review on Reviewable.io

@manishrjain
Copy link
Contributor

One last small comment. But, otherwise :lgtm: ! Good job!


Reviewed 6 of 6 files at r4, 6 of 6 files at r5.
Review status: all files reviewed at latest revision, 9 unresolved discussions.


uid/assigner.go, line 97 [r5] (raw file):
Do mod first, and then use it here.
minIdx := instanceIdx * mod


Comments from the review on Reviewable.io

ashwin95r added a commit that referenced this pull request Feb 3, 2016
@ashwin95r ashwin95r merged commit 9b9d270 into dgraph-io:master Feb 3, 2016
janardhan1993 pushed a commit that referenced this pull request Jun 26, 2017
danielmai pushed a commit that referenced this pull request May 1, 2020
Root page for documentation
arijitAD pushed a commit that referenced this pull request Oct 15, 2020
shivaji-dgraph pushed a commit that referenced this pull request Mar 12, 2024
Description: We configure CI so that workflows can checkout other private repositories.
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.

None yet

3 participants