-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Add indices setter to IndicesRequest interface #7734
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after thinking about it for a while, I think it'd be better to introduce a sub-interface of the public interface IndicesRequest {
String[] indices();
IndicesOptions indicesOptions();
static Replaceable extends IndicesRequest {
void indices(String... indices);
}
} And then for each request choose which one to implement (it'll will avoid all the cases where right now we throw an exception or don't support re-setting the indices) |
javanna
force-pushed
the
enhancement/indices_request_setter
branch
from
September 16, 2014 11:22
bad8a5d
to
0934a94
Compare
Agreed @uboness I just pushed a couple of new commits to address your feedback |
LGTM |
javanna
force-pushed
the
enhancement/indices_request_setter
branch
from
September 18, 2014 12:24
c2a0936
to
7e258e6
Compare
We currently expose generic getters for indices and indicesOptions on the IndicesRequest interface. This commit adds a generic setter as well, which can be used to set the indices to a request. The setter impl throws `UnsupportedOperationException` if called on internal requests. Also throws exception if called on single index operations, since it accepts an array as argument.
javanna
force-pushed
the
enhancement/indices_request_setter
branch
from
September 18, 2014 12:24
7e258e6
to
bb4ff2c
Compare
javanna
added a commit
to javanna/elasticsearch
that referenced
this pull request
Sep 18, 2014
We currently expose generic getters for indices and indicesOptions on the IndicesRequest interface. This commit adds a generic setter as well, which can be used to set the indices to a request. The setter impl throws `UnsupportedOperationException` if called on internal requests. Also throws exception if called on single index operations, since it accepts an array as argument. Closes elastic#7734
javanna
added a commit
to javanna/elasticsearch
that referenced
this pull request
Sep 18, 2014
We currently expose generic getters for indices and indicesOptions on the IndicesRequest interface. This commit adds a generic setter as well, which can be used to set the indices to a request. The setter impl throws `UnsupportedOperationException` if called on internal requests. Also throws exception if called on single index operations, since it accepts an array as argument. Closes elastic#7734
clintongormley
changed the title
Internal: add indices setter to IndicesRequest interface
Add indices setter to IndicesRequest interface
Jun 7, 2015
mute
pushed a commit
to mute/elasticsearch
that referenced
this pull request
Jul 29, 2015
We currently expose generic getters for indices and indicesOptions on the IndicesRequest interface. This commit adds a generic setter as well, which can be used to set the indices to a request. The setter impl throws `UnsupportedOperationException` if called on internal requests. Also throws exception if called on single index operations, since it accepts an array as argument. Closes elastic#7734
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently expose generic getters for
indices
andindicesOptions
on theIndicesRequest
interface. This commit adds a generic setter as well, which can be used to set the indices to a request. The setter impl throwsUnsupportedOperationException
if called on internal requests, since it makes sense to eventually replace the indices on external requests only. Also throws exception when the set operation doesn't make sense.