Expose WriteRequest.RefreshPolicy string representation#23106
Merged
tlrx merged 3 commits intoelastic:masterfrom Feb 13, 2017
Merged
Expose WriteRequest.RefreshPolicy string representation#23106tlrx merged 3 commits intoelastic:masterfrom
tlrx merged 3 commits intoelastic:masterfrom
Conversation
This commit changes the RefreshPolicy enum so that string representation are exposed. This will help the high level rest client to simply use refreshPolicy.getValue() to get the corresponding parameter value of a given refresh policy.
javanna
suggested changes
Feb 10, 2017
Contributor
javanna
left a comment
There was a problem hiding this comment.
left a couple of comments
| * Don't refresh after this request. The default. | ||
| */ | ||
| NONE, | ||
| NONE((byte) 0, Boolean.FALSE.toString()), |
Contributor
There was a problem hiding this comment.
nit: I am wondering if using "true" and "false" would be more readable, simply because I always forget if it's lowercase or uppercase.
| WAIT_UNTIL; | ||
| WAIT_UNTIL((byte) 2, "wait_for"); | ||
|
|
||
| private final byte id; |
Contributor
There was a problem hiding this comment.
can we remove the id member and stick with the enum ordinal like we were doing before?
| return policy; | ||
| } | ||
| } | ||
| throw new IllegalArgumentException("No cluster block level matching [" + id + "]"); |
Contributor
There was a problem hiding this comment.
is this a cluster block level?
Member
Author
There was a problem hiding this comment.
It's a wonderful copy paste
Member
Author
|
Thanks @javanna, I updated the code. |
nik9000
approved these changes
Feb 10, 2017
| public void writeTo(StreamOutput out) throws IOException { | ||
| out.writeByte(getId()); | ||
| } | ||
| out.writeByte((byte) ordinal()); } |
javanna
approved these changes
Feb 10, 2017
Contributor
javanna
left a comment
There was a problem hiding this comment.
LGTM besides nik's comment
Member
Author
tlrx
added a commit
that referenced
this pull request
Feb 13, 2017
This commit changes the RefreshPolicy enum so that string representation are exposed. This will help the high level rest client to simply use refreshPolicy.getValue() to get the corresponding parameter value of a given refresh policy.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit changes the
RefreshPolicyenum so that string representation are exposed. This will help the high level rest client to simply userefreshPolicy.getValue()to get the corresponding parameter value of a given refresh policy.