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 @@ -8,7 +8,6 @@
*/
package org.elasticsearch.action;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.bulk.IndexDocFailureStoreStatus;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.action.support.WriteRequest.RefreshPolicy;
Expand Down Expand Up @@ -115,10 +114,6 @@ public DocWriteResponse(ShardId shardId, String id, long seqNo, long primaryTerm
protected DocWriteResponse(ShardId shardId, StreamInput in) throws IOException {
super(in);
this.shardId = shardId;
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
String type = in.readString();
assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]";
}
id = in.readString();
version = in.readZLong();
seqNo = in.readZLong();
Expand All @@ -134,10 +129,6 @@ protected DocWriteResponse(ShardId shardId, StreamInput in) throws IOException {
protected DocWriteResponse(StreamInput in) throws IOException {
super(in);
shardId = new ShardId(in);
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
String type = in.readString();
assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]";
}
id = in.readString();
version = in.readZLong();
seqNo = in.readZLong();
Expand Down Expand Up @@ -266,9 +257,6 @@ public void writeTo(StreamOutput out) throws IOException {
}

private void writeWithoutShardId(StreamOutput out) throws IOException {
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeString(MapperService.SINGLE_MAPPING_NAME);
}
out.writeString(id);
out.writeZLong(version);
out.writeZLong(seqNo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
package org.elasticsearch.action.admin.cluster.configuration;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.MasterNodeRequest;
import org.elasticsearch.cluster.ClusterState;
Expand Down Expand Up @@ -78,12 +77,6 @@ public AddVotingConfigExclusionsRequest(TimeValue masterNodeTimeout, String[] no

public AddVotingConfigExclusionsRequest(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
final String[] legacyNodeDescriptions = in.readStringArray();
if (legacyNodeDescriptions.length > 0) {
throw new IllegalArgumentException("legacy [node_name] field was deprecated and must be empty");
}
}
nodeIds = in.readStringArray();
nodeNames = in.readStringArray();
timeout = in.readTimeValue();
Expand Down Expand Up @@ -191,9 +184,6 @@ public ActionRequestValidationException validate() {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeStringArray(Strings.EMPTY_ARRAY);
}
out.writeStringArray(nodeIds);
out.writeStringArray(nodeNames);
out.writeTimeValue(timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package org.elasticsearch.action.admin.cluster.snapshots.create;

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
Expand All @@ -21,7 +20,6 @@
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.xcontent.ToXContentObject;
Expand All @@ -36,7 +34,6 @@

import static org.elasticsearch.action.ValidateActions.addValidationError;
import static org.elasticsearch.common.Strings.EMPTY_ARRAY;
import static org.elasticsearch.common.settings.Settings.readSettingsFromStream;
import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeBooleanValue;

/**
Expand All @@ -58,8 +55,6 @@ public class CreateSnapshotRequest extends MasterNodeRequest<CreateSnapshotReque
IndicesRequest.Replaceable,
ToXContentObject {

public static final TransportVersion SETTINGS_IN_REQUEST_VERSION = TransportVersions.V_8_0_0;

public static final int MAXIMUM_METADATA_BYTES = 1024; // chosen arbitrarily

private String snapshot;
Expand Down Expand Up @@ -107,9 +102,6 @@ public CreateSnapshotRequest(StreamInput in) throws IOException {
repository = in.readString();
indices = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);
if (in.getTransportVersion().before(SETTINGS_IN_REQUEST_VERSION)) {
readSettingsFromStream(in);
}
featureStates = in.readStringArray();
includeGlobalState = in.readBoolean();
waitForCompletion = in.readBoolean();
Expand All @@ -125,9 +117,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(repository);
out.writeStringArray(indices);
indicesOptions.writeIndicesOptions(out);
if (out.getTransportVersion().before(SETTINGS_IN_REQUEST_VERSION)) {
Settings.EMPTY.writeTo(out);
}
out.writeStringArray(featureStates);
out.writeBoolean(includeGlobalState);
out.writeBoolean(waitForCompletion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,7 @@ public CreateIndexRequest(StreamInput in) throws IOException {
cause = in.readString();
index = in.readString();
settings = readSettingsFromStream(in);
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
int size = in.readVInt();
assert size <= 1 : "Expected to read 0 or 1 mappings, but received " + size;
if (size == 1) {
String type = in.readString();
if (MapperService.SINGLE_MAPPING_NAME.equals(type) == false) {
throw new IllegalArgumentException("Expected to receive mapping type of [_doc] but got [" + type + "]");
}
mappings = in.readString();
}
} else {
mappings = in.readString();
}
mappings = in.readString();
int aliasesSize = in.readVInt();
for (int i = 0; i < aliasesSize; i++) {
aliases.add(new Alias(in));
Expand Down Expand Up @@ -510,17 +498,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeString(cause);
out.writeString(index);
settings.writeTo(out);
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
if ("{}".equals(mappings)) {
out.writeVInt(0);
} else {
out.writeVInt(1);
out.writeString(MapperService.SINGLE_MAPPING_NAME);
out.writeString(mappings);
}
} else {
out.writeString(mappings);
}
out.writeString(mappings);
out.writeCollection(aliases);
waitForActiveShards.writeTo(out);
out.writeString(origin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

package org.elasticsearch.action.admin.indices.forcemerge;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.broadcast.BroadcastRequest;
import org.elasticsearch.common.UUIDs;
Expand Down Expand Up @@ -48,8 +46,6 @@ public static final class Defaults {
*/
private boolean shouldStoreResult;

private static final TransportVersion FORCE_MERGE_UUID_SIMPLE_VERSION = TransportVersions.V_8_0_0;

/**
* Force merge UUID to store in the live commit data of a shard under
* {@link org.elasticsearch.index.engine.Engine#FORCE_MERGE_UUID_KEY} after force merging it.
Expand All @@ -71,12 +67,7 @@ public ForceMergeRequest(StreamInput in) throws IOException {
maxNumSegments = in.readInt();
onlyExpungeDeletes = in.readBoolean();
flush = in.readBoolean();
if (in.getTransportVersion().onOrAfter(FORCE_MERGE_UUID_SIMPLE_VERSION)) {
forceMergeUUID = in.readString();
} else {
forceMergeUUID = in.readOptionalString();
assert forceMergeUUID != null : "optional was just used as a BwC measure";
}
forceMergeUUID = in.readString();
}

/**
Expand Down Expand Up @@ -167,11 +158,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeInt(maxNumSegments);
out.writeBoolean(onlyExpungeDeletes);
out.writeBoolean(flush);
if (out.getTransportVersion().onOrAfter(FORCE_MERGE_UUID_SIMPLE_VERSION)) {
out.writeString(forceMergeUUID);
} else {
out.writeOptionalString(forceMergeUUID);
}
out.writeString(forceMergeUUID);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ public CommonStats(StreamInput in) throws IOException {
translog = in.readOptionalWriteable(TranslogStats::new);
requestCache = in.readOptionalWriteable(RequestCacheStats::new);
recoveryStats = in.readOptionalWriteable(RecoveryStats::new);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) {
bulk = in.readOptionalWriteable(BulkStats::new);
}
bulk = in.readOptionalWriteable(BulkStats::new);
shards = in.readOptionalWriteable(ShardCountStats::new);
if (in.getTransportVersion().onOrAfter(VERSION_SUPPORTING_NODE_MAPPINGS)) {
nodeMappings = in.readOptionalWriteable(NodeMappingStats::new);
Expand Down Expand Up @@ -250,9 +248,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalWriteable(translog);
out.writeOptionalWriteable(requestCache);
out.writeOptionalWriteable(recoveryStats);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_0_0)) {
out.writeOptionalWriteable(bulk);
}
out.writeOptionalWriteable(bulk);
out.writeOptionalWriteable(shards);
if (out.getTransportVersion().onOrAfter(VERSION_SUPPORTING_NODE_MAPPINGS)) {
out.writeOptionalWriteable(nodeMappings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

package org.elasticsearch.action.admin.indices.stats;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
Expand Down Expand Up @@ -56,9 +54,6 @@ public CommonStatsFlags(StreamInput in) throws IOException {
flags.add(flag);
}
}
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
in.readStringArray();
}
groups = in.readStringArray();
fieldDataFields = in.readStringArray();
completionDataFields = in.readStringArray();
Expand All @@ -73,10 +68,6 @@ public void writeTo(StreamOutput out) throws IOException {
longFlags |= (1 << flag.getIndex());
}
out.writeLong(longFlags);

if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeStringArrayNullable(Strings.EMPTY_ARRAY);
}
out.writeStringArrayNullable(groups);
out.writeStringArrayNullable(fieldDataFields);
out.writeStringArrayNullable(completionDataFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.seqno.SequenceNumbers;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.RestStatus;
Expand Down Expand Up @@ -189,11 +188,6 @@ private Failure(
*/
public Failure(StreamInput in) throws IOException {
index = in.readString();
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
in.readString();
// can't make an assertion about type names here because too many tests still set their own
// types bypassing various checks
}
id = in.readOptionalString();
cause = in.readException();
status = ExceptionsHelper.status(cause);
Expand All @@ -210,9 +204,6 @@ public Failure(StreamInput in) throws IOException {
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(index);
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeString(MapperService.SINGLE_MAPPING_NAME);
}
out.writeOptionalString(id);
out.writeException(cause);
out.writeZLong(seqNo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package org.elasticsearch.action.delete;

import org.apache.lucene.util.RamUsageEstimator;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.DocWriteRequest;
Expand All @@ -22,7 +21,6 @@
import org.elasticsearch.common.lucene.uid.Versions;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.shard.ShardId;

import java.io.IOException;
Expand Down Expand Up @@ -63,10 +61,6 @@ public DeleteRequest(StreamInput in) throws IOException {

public DeleteRequest(@Nullable ShardId shardId, StreamInput in) throws IOException {
super(shardId, in);
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
String type = in.readString();
assert MapperService.SINGLE_MAPPING_NAME.equals(type) : "Expected [_doc] but received [" + type + "]";
}
id = in.readString();
routing = in.readOptionalString();
version = in.readLong();
Expand Down Expand Up @@ -255,9 +249,6 @@ public void writeThin(StreamOutput out) throws IOException {
}

private void writeBody(StreamOutput out) throws IOException {
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeString(MapperService.SINGLE_MAPPING_NAME);
}
out.writeString(id);
out.writeOptionalString(routing());
out.writeLong(version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@

package org.elasticsearch.action.explain;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.support.single.shard.SingleShardRequest;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
import org.elasticsearch.search.internal.AliasFilter;
Expand Down Expand Up @@ -55,10 +53,6 @@ public ExplainRequest(String index, String id) {

ExplainRequest(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
String type = in.readString();
assert MapperService.SINGLE_MAPPING_NAME.equals(type);
}
id = in.readString();
routing = in.readOptionalString();
preference = in.readOptionalString();
Expand Down Expand Up @@ -161,9 +155,6 @@ public ActionRequestValidationException validate() {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeString(MapperService.SINGLE_MAPPING_NAME);
}
out.writeString(id);
out.writeOptionalString(routing);
out.writeOptionalString(preference);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
package org.elasticsearch.action.explain;

import org.apache.lucene.search.Explanation;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.get.GetResult;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xcontent.ToXContentObject;
Expand Down Expand Up @@ -65,9 +63,6 @@ public ExplainResponse(String index, String id, boolean exists, Explanation expl

public ExplainResponse(StreamInput in) throws IOException {
index = in.readString();
if (in.getTransportVersion().before(TransportVersions.V_8_0_0)) {
in.readString();
}
id = in.readString();
exists = in.readBoolean();
if (in.readBoolean()) {
Expand Down Expand Up @@ -113,9 +108,6 @@ public RestStatus status() {
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(index);
if (out.getTransportVersion().before(TransportVersions.V_8_0_0)) {
out.writeString(MapperService.SINGLE_MAPPING_NAME);
}
out.writeString(id);
out.writeBoolean(exists);
if (explanation == null) {
Expand Down
Loading