Skip to content
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

Remove runtime version checks #8768

Merged
merged 1 commit into from Dec 4, 2014

Conversation

Projects
None yet
3 participants
@s1monw
Copy link
Contributor

commented Dec 3, 2014

This cleanup commmit removes a large protion of the versioned reads / writes
in the network protocol since master requires a full cluster restart.

@jpountz

View changes

src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java Outdated
@@ -139,9 +135,7 @@ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
AllocationCommands.writeTo(commands, out);
out.writeBoolean(dryRun);
if (out.getVersion().onOrAfter(Version.V_1_1_0)) {
out.writeBoolean(explain);

This comment has been minimized.

Copy link
@jpountz

jpountz Dec 3, 2014

Contributor

can you fix the indentation?

@jpountz

View changes

src/main/java/org/elasticsearch/action/get/MultiGetShardRequest.java Outdated
@@ -121,51 +121,10 @@ public void readFrom(StreamInput in) throws IOException {
locations = new IntArrayList(size);
items = new ArrayList<>(size);

if (in.getVersion().onOrAfter(Version.V_1_4_0_Beta1)) {
for (int i = 0; i < size; i++) {
locations.add(in.readVInt());
items.add(MultiGetRequest.Item.readItem(in));

This comment has been minimized.

Copy link
@jpountz

jpountz Dec 3, 2014

Contributor

Can you fix the indentation?

@jpountz

View changes

src/main/java/org/elasticsearch/action/mlt/MoreLikeThisRequest.java Outdated
@@ -631,19 +627,9 @@ public void readFrom(StreamInput in) throws IOException {
minWordLength = in.readVInt();
maxWordLength = in.readVInt();
boostTerms = in.readFloat();
if (in.getVersion().onOrAfter(Version.V_1_2_0)) {
include = in.readBoolean();

This comment has been minimized.

Copy link
@jpountz

jpountz Dec 3, 2014

Contributor

indentation

@jpountz

View changes

src/main/java/org/elasticsearch/action/mlt/MoreLikeThisRequest.java Outdated
@@ -693,11 +679,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
}

if (out.getVersion().onOrAfter(Version.V_1_5_0)) {
out.writeString(minimumShouldMatch);

This comment has been minimized.

Copy link
@jpountz

jpountz Dec 3, 2014

Contributor

indentation

@jpountz

View changes

src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java Outdated
@@ -592,7 +590,7 @@ public static MappingMetaData readFrom(StreamInput in) throws IOException {
Routing routing = new Routing(in.readBoolean(), in.readBoolean() ? in.readString() : null);
// timestamp
Timestamp timestamp = new Timestamp(in.readBoolean(), in.readBoolean() ? in.readString() : null, in.readString(),
in.getVersion().onOrAfter(Version.V_1_4_0_Beta1) ? (in.readBoolean() ? in.readString() : null) : TimestampFieldMapper.Defaults.DEFAULT_TIMESTAMP);
(in.readBoolean() ? in.readString() : null));

This comment has been minimized.

Copy link
@jpountz

jpountz Dec 3, 2014

Contributor

I think this would be easier to read with in.readOptionalString?

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2014

The change looks good, there are just a couple of places that need indentation fixes. Please feel free to push without further review.

And thanks for doing this!

@s1monw s1monw force-pushed the s1monw:cleanup_version branch Dec 4, 2014

Remove runtime version checks
This cleanup commmit removes a large protion of the versioned reads / writes
in the network protocol since master requires a full cluster restart.

@s1monw s1monw force-pushed the s1monw:cleanup_version branch to 219bb88 Dec 4, 2014

@s1monw s1monw merged commit 219bb88 into elastic:master Dec 4, 2014

@s1monw s1monw deleted the s1monw:cleanup_version branch Dec 4, 2014

@clintongormley clintongormley removed the review label Mar 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.