Skip to content

Refactoring of MissingQuery#12030

Closed
alexksikes wants to merge 0 commit intoelastic:feature/query-refactoringfrom
alexksikes:feature/query-refactoring-missing
Closed

Refactoring of MissingQuery#12030
alexksikes wants to merge 0 commit intoelastic:feature/query-refactoringfrom
alexksikes:feature/query-refactoring-missing

Conversation

@alexksikes
Copy link
Copy Markdown
Contributor

Relates to #10217

This PR is against the query-refactoring branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make this case 4 instead of default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the method needs to return though

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As this is only in the test I think we are save assuming that randomIntBetween can only return values between 0 and 3, so leaving the largest value as default should be ok. Current implementation is fine as well of course.

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Jul 6, 2015

left two tiny comments, looks good though

@alexksikes
Copy link
Copy Markdown
Contributor Author

@javanna Thanks for the review. I updated the PR accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

before you would randomly return unmapped field names, now you never do. randomIntBetween(0, 4) was ok, case 4 was ok too, you can just throw UnsupportedOperationException from the default or something.

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Jul 8, 2015

left a couple of minor comments, @cbuescher do you mind having a look too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reading just the method name, I was curious what it means in this context. Maybe short comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

good point, actually given that it's a public method some javadocs wouldn't hurt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes I'll add these, thanks for seeing this.

@cbuescher
Copy link
Copy Markdown
Member

Also did a round of reviews, left some remarks.

@alexksikes
Copy link
Copy Markdown
Contributor Author

@javanna @cbuescher thanks for the review. I updated the PR accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would rather test this by calling the newFilter static method. In fact the check that we left there instead of relying on validate is there ony to protect other code paths from the outside (newFilter is public)

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Jul 13, 2015

did another round, left a few small comments

@alexksikes
Copy link
Copy Markdown
Contributor Author

@javanna I updated the PR. Thanks.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does this work? Above PROTOTYPE is initialized with null which will result in an exception being thrown here.

@MaineC
Copy link
Copy Markdown

MaineC commented Jul 14, 2015

Left a few comments.

@alexksikes
Copy link
Copy Markdown
Contributor Author

@MaineC Thanks for the review. I updated the PR.

@alexksikes alexksikes force-pushed the feature/query-refactoring-missing branch from d9398ce to 64a50fd Compare July 23, 2015 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search/Search Search-related issues that do not fall into other categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants