Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public EnumSet<WildcardStates> getExpandWildcards() {

public void writeIndicesOptions(StreamOutput out) throws IOException {
out.writeEnumSet(options);
if (out.getVersion().before(Version.V_8_0_0) && expandWildcards.contains(WildcardStates.HIDDEN)) {
if (out.getVersion().before(Version.V_7_7_0) && expandWildcards.contains(WildcardStates.HIDDEN)) {
final EnumSet<WildcardStates> states = EnumSet.copyOf(expandWildcards);
states.remove(WildcardStates.HIDDEN);
out.writeEnumSet(states);
Expand All @@ -235,7 +235,7 @@ public void writeIndicesOptions(StreamOutput out) throws IOException {
public static IndicesOptions readIndicesOptions(StreamInput in) throws IOException {
EnumSet<Option> options = in.readEnumSet(Option.class);
EnumSet<WildcardStates> states = in.readEnumSet(WildcardStates.class);
if (in.getVersion().before(Version.V_8_0_0)) {
if (in.getVersion().before(Version.V_7_7_0)) {
states.add(WildcardStates.HIDDEN);
}
return new IndicesOptions(options, states);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ public void testOriginalIndicesSerialization() throws IOException {
// indices options are not equivalent when sent to an older version and re-read due
// to the addition of hidden indices as expand to hidden indices is always true when
// read from a prior version
// TODO update version on backport!
if (out.getVersion().onOrAfter(Version.V_8_0_0) || originalIndices.indicesOptions().expandWildcardsHidden()) {
if (out.getVersion().onOrAfter(Version.V_7_7_0) || originalIndices.indicesOptions().expandWildcardsHidden()) {
assertThat(originalIndices2.indicesOptions(), equalTo(originalIndices.indicesOptions()));
} else if (originalIndices.indicesOptions().expandWildcardsHidden()) {
assertThat(originalIndices2.indicesOptions(), equalTo(originalIndices.indicesOptions()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void testSerialization() throws Exception {
// indices options are not equivalent when sent to an older version and re-read due
// to the addition of hidden indices as expand to hidden indices is always true when
// read from a prior version
if (version.onOrAfter(Version.V_8_0_0) || request.indicesOptions().expandWildcardsHidden()) { // TODO change on backport!
if (version.onOrAfter(Version.V_7_7_0) || request.indicesOptions().expandWildcardsHidden()) {
assertEquals(request.indicesOptions(), deserialized.indicesOptions());
}
assertEquals(request.routing(), deserialized.routing());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testBwcSerialization() throws Exception {
// to the addition of hidden indices as expand to hidden indices is always true when
// read from a prior version
// TODO update version on backport!
if (out.getVersion().onOrAfter(Version.V_8_0_0) || request.indicesOptions().expandWildcardsHidden()) {
if (out.getVersion().onOrAfter(Version.V_7_7_0) || request.indicesOptions().expandWildcardsHidden()) {
assertEquals(request.indicesOptions(), indicesOptions);
}
if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
Expand Down Expand Up @@ -104,7 +104,7 @@ public void testBwcSerialization() throws Exception {
// to the addition of hidden indices as expand to hidden indices is always true when
// read from a prior version
// TODO change version on backport
if (out.getVersion().onOrAfter(Version.V_8_0_0) || sample.indicesOptions().expandWildcardsHidden()) {
if (out.getVersion().onOrAfter(Version.V_7_7_0) || sample.indicesOptions().expandWildcardsHidden()) {
assertEquals(sample.indicesOptions(), deserializedRequest.indicesOptions());
}
if (out.getVersion().onOrAfter(Version.V_7_2_0)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void testSerialization() throws Exception {
assertThat(indicesOptions2.allowNoIndices(), equalTo(indicesOptions.allowNoIndices()));
assertThat(indicesOptions2.expandWildcardsOpen(), equalTo(indicesOptions.expandWildcardsOpen()));
assertThat(indicesOptions2.expandWildcardsClosed(), equalTo(indicesOptions.expandWildcardsClosed()));
if (version.before(Version.V_8_0_0)) {
if (version.before(Version.V_7_7_0)) {
assertThat(indicesOptions2.expandWildcardsHidden(), is(true));
} else {
assertThat(indicesOptions2.expandWildcardsHidden(), equalTo(indicesOptions.expandWildcardsHidden()));
Expand Down