Replace Version checks against 1.0 with 1.0RC2
This commit is contained in:
parent
d49f099fdb
commit
1615aba114
|
@ -88,13 +88,13 @@ public class GetRepositoriesRequest extends MasterNodeReadOperationRequest<GetRe
|
|||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
repositories = in.readStringArray();
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeStringArray(repositories);
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,12 +39,12 @@ public class PendingClusterTasksRequest extends MasterNodeReadOperationRequest<P
|
|||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class GetAliasesRequest extends MasterNodeReadOperationRequest<GetAliases
|
|||
indices = in.readStringArray();
|
||||
aliases = in.readStringArray();
|
||||
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,6 +95,6 @@ public class GetAliasesRequest extends MasterNodeReadOperationRequest<GetAliases
|
|||
out.writeStringArray(indices);
|
||||
out.writeStringArray(aliases);
|
||||
indicesOptions.writeIndicesOptions(out);
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class IndicesExistsRequest extends MasterNodeReadOperationRequest<Indices
|
|||
super.readFrom(in);
|
||||
indices = in.readStringArray();
|
||||
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,6 +80,6 @@ public class IndicesExistsRequest extends MasterNodeReadOperationRequest<Indices
|
|||
super.writeTo(out);
|
||||
out.writeStringArray(indices);
|
||||
indicesOptions.writeIndicesOptions(out);
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class TypesExistsRequest extends MasterNodeReadOperationRequest<TypesExis
|
|||
out.writeStringArray(indices);
|
||||
out.writeStringArray(types);
|
||||
indicesOptions.writeIndicesOptions(out);
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -98,6 +98,6 @@ public class TypesExistsRequest extends MasterNodeReadOperationRequest<TypesExis
|
|||
indices = in.readStringArray();
|
||||
types = in.readStringArray();
|
||||
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class GetSettingsRequest extends MasterNodeReadOperationRequest<GetSettin
|
|||
indices = in.readStringArray();
|
||||
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
||||
names = in.readStringArray();
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,6 +89,6 @@ public class GetSettingsRequest extends MasterNodeReadOperationRequest<GetSettin
|
|||
out.writeStringArray(indices);
|
||||
indicesOptions.writeIndicesOptions(out);
|
||||
out.writeStringArray(names);
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class GetIndexTemplatesRequest extends MasterNodeReadOperationRequest<Get
|
|||
names = new String[1];
|
||||
names[0] = in.readString();
|
||||
}
|
||||
readLocal(in, Version.V_1_0_0);
|
||||
readLocal(in, Version.V_1_0_0_RC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,6 +93,6 @@ public class GetIndexTemplatesRequest extends MasterNodeReadOperationRequest<Get
|
|||
} else {
|
||||
out.writeString(names.length == 0 ? "*" : names[0]);
|
||||
}
|
||||
writeLocal(out, Version.V_1_0_0);
|
||||
writeLocal(out, Version.V_1_0_0_RC2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ public class TypeParsers {
|
|||
}
|
||||
} else if (propName.equals("omit_term_freq_and_positions")) {
|
||||
final IndexOptions op = nodeBooleanValue(propNode) ? IndexOptions.DOCS_ONLY : IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
|
||||
if (parserContext.indexVersionCreated().onOrAfter(Version.V_1_0_0)) {
|
||||
if (parserContext.indexVersionCreated().onOrAfter(Version.V_1_0_0_RC2)) {
|
||||
throw new ElasticsearchParseException("'omit_term_freq_and_positions' is not supported anymore - use ['index_options' : '" + op.name() + "'] instead");
|
||||
}
|
||||
// deprecated option for BW compat
|
||||
|
|
|
@ -344,7 +344,7 @@ public class SimpleQueryTests extends ElasticsearchIntegrationTest {
|
|||
assertAcked(client().admin().indices().prepareCreate("test")
|
||||
.addMapping("type1", "field1", "type=string,omit_term_freq_and_positions=true")
|
||||
.setSettings(SETTING_NUMBER_OF_SHARDS, 1, IndexMetaData.SETTING_VERSION_CREATED, version.id));
|
||||
assertThat(version.onOrAfter(Version.V_1_0_0), equalTo(false));
|
||||
assertThat(version.onOrAfter(Version.V_1_0_0_RC2), equalTo(false));
|
||||
indexRandom(true, client().prepareIndex("test", "type1", "1").setSource("field1", "quick brown fox", "field2", "quick brown fox"),
|
||||
client().prepareIndex("test", "type1", "2").setSource("field1", "quick lazy huge brown fox", "field2", "quick lazy huge brown fox"));
|
||||
|
||||
|
@ -358,7 +358,7 @@ public class SimpleQueryTests extends ElasticsearchIntegrationTest {
|
|||
}
|
||||
wipeIndices("test");
|
||||
} catch (MapperParsingException ex) {
|
||||
assertThat(version.toString(), version.onOrAfter(Version.V_1_0_0), equalTo(true));
|
||||
assertThat(version.toString(), version.onOrAfter(Version.V_1_0_0_RC2), equalTo(true));
|
||||
assertThat(ex.getCause().getMessage(), equalTo("'omit_term_freq_and_positions' is not supported anymore - use ['index_options' : 'DOCS_ONLY'] instead"));
|
||||
}
|
||||
version = randomVersion();
|
||||
|
|
Loading…
Reference in New Issue