Skip to content
Closed
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 @@ -75,7 +75,6 @@ static TransportVersion def(int id) {
public static final TransportVersion V_8_13_4 = def(8_595_0_01);
public static final TransportVersion V_8_14_0 = def(8_636_0_01);
public static final TransportVersion V_8_15_0 = def(8_702_0_02);
public static final TransportVersion V_8_15_2 = def(8_702_0_03);
public static final TransportVersion V_8_16_0 = def(8_772_0_01);
// TODO: leave this version until the very end to satisfy max transport version test
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_5 = def(8_797_0_05);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,13 @@ public Response(Map<String, NodeAllocationStats> nodeAllocationStats, DiskThresh

public Response(StreamInput in) throws IOException {
this.nodeAllocationStats = in.readImmutableMap(StreamInput::readString, NodeAllocationStats::new);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
this.diskThresholdSettings = in.readOptionalWriteable(DiskThresholdSettings::readFrom);
} else {
this.diskThresholdSettings = null;
}
this.diskThresholdSettings = in.readOptionalWriteable(DiskThresholdSettings::readFrom);
}

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeMap(nodeAllocationStats, StreamOutput::writeString, StreamOutput::writeWriteable);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeOptionalWriteable(diskThresholdSettings);
} else {
assert diskThresholdSettings == null;
}
out.writeOptionalWriteable(diskThresholdSettings);
}

public Map<String, NodeAllocationStats> getNodeAllocationStats() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.action.admin.cluster.node.stats;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.FailedNodeException;
Expand Down Expand Up @@ -186,9 +185,6 @@ public static class NodeStatsRequest extends AbstractTransportRequest {
public NodeStatsRequest(StreamInput in) throws IOException {
super(in);
this.nodesStatsRequestParameters = new NodesStatsRequestParameters(in);
if (in.getTransportVersion().between(TransportVersions.V_8_13_0, TransportVersions.V_8_15_0)) {
in.readStringArray(); // formerly nodeIds, now unused
}
}

NodeStatsRequest(NodesStatsRequest request) {
Expand All @@ -213,9 +209,6 @@ public String getDescription() {
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
nodesStatsRequestParameters.writeTo(out);
if (out.getTransportVersion().between(TransportVersions.V_8_13_0, TransportVersions.V_8_15_0)) {
out.writeStringArray(Strings.EMPTY_ARRAY); // formerly nodeIds, now unused
}
}

public NodesStatsRequestParameters getNodesStatsRequestParameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/
package org.elasticsearch.action.admin.cluster.repositories.cleanup;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.common.io.stream.StreamInput;
Expand All @@ -29,11 +28,7 @@ public CleanupRepositoryRequest(TimeValue masterNodeTimeout, TimeValue ackTimeou
}

public static CleanupRepositoryRequest readFrom(StreamInput in) throws IOException {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
return new CleanupRepositoryRequest(in);
} else {
return new CleanupRepositoryRequest(TimeValue.THIRTY_SECONDS, TimeValue.THIRTY_SECONDS, in);
}
return new CleanupRepositoryRequest(in);
}

private CleanupRepositoryRequest(StreamInput in) throws IOException {
Expand All @@ -48,9 +43,7 @@ public CleanupRepositoryRequest(TimeValue masterNodeTimeout, TimeValue ackTimeou

@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
super.writeTo(out);
}
super.writeTo(out);
out.writeString(repository);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.action.admin.cluster.snapshots.delete;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.MasterNodeRequest;
import org.elasticsearch.common.Strings;
Expand Down Expand Up @@ -51,21 +50,15 @@ public DeleteSnapshotRequest(StreamInput in) throws IOException {
super(in);
repository = in.readString();
snapshots = in.readStringArray();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
waitForCompletion = in.readBoolean();
}
waitForCompletion = in.readBoolean();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeString(repository);
out.writeStringArray(snapshots);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeBoolean(waitForCompletion);
} else {
assert waitForCompletion : "Using wait_for_completion parameter when it should have been disallowed";
}
out.writeBoolean(waitForCompletion);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.action.admin.cluster.snapshots.delete;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.support.ActionFilters;
Expand Down Expand Up @@ -65,9 +64,6 @@ protected ClusterBlockException checkBlock(DeleteSnapshotRequest request, Cluste

@Override
protected void doExecute(Task task, DeleteSnapshotRequest request, ActionListener<AcknowledgedResponse> listener) {
if (clusterService.state().getMinTransportVersion().before(TransportVersions.V_8_15_0) && request.waitForCompletion() == false) {
throw new UnsupportedOperationException("wait_for_completion parameter is not supported by all nodes in this cluster");
}
super.doExecute(task, request, listener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ public CreateIndexRequest(StreamInput in) throws IOException {
} else {
requireDataStream = false;
}
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
initializeFailureStore = in.readBoolean();
} else {
initializeFailureStore = true;
}
initializeFailureStore = in.readBoolean();
}

public CreateIndexRequest() {
Expand Down Expand Up @@ -505,9 +501,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_13_0)) {
out.writeBoolean(this.requireDataStream);
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeBoolean(this.initializeFailureStore);
}
out.writeBoolean(this.initializeFailureStore);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

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

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.support.broadcast.BroadcastRequest;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
Expand All @@ -31,9 +30,7 @@ public IndicesSegmentsRequest() {

public IndicesSegmentsRequest(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
this.includeVectorFormatsInfo = in.readBoolean();
}
this.includeVectorFormatsInfo = in.readBoolean();
}

public IndicesSegmentsRequest(String... indices) {
Expand All @@ -53,9 +50,7 @@ public boolean isIncludeVectorFormatsInfo() {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeBoolean(includeVectorFormatsInfo);
}
out.writeBoolean(includeVectorFormatsInfo);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
public class CommonStats implements Writeable, ToXContentFragment {

private static final TransportVersion VERSION_SUPPORTING_DENSE_VECTOR_STATS = TransportVersions.V_8_10_X;
private static final TransportVersion VERSION_SUPPORTING_SPARSE_VECTOR_STATS = TransportVersions.V_8_15_0;

@Nullable
public DocsStats docs;
Expand Down Expand Up @@ -222,9 +221,7 @@ public CommonStats(StreamInput in) throws IOException {
if (in.getTransportVersion().onOrAfter(VERSION_SUPPORTING_DENSE_VECTOR_STATS)) {
denseVectorStats = in.readOptionalWriteable(DenseVectorStats::new);
}
if (in.getTransportVersion().onOrAfter(VERSION_SUPPORTING_SPARSE_VECTOR_STATS)) {
sparseVectorStats = in.readOptionalWriteable(SparseVectorStats::new);
}
sparseVectorStats = in.readOptionalWriteable(SparseVectorStats::new);
}

@Override
Expand All @@ -251,9 +248,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(VERSION_SUPPORTING_DENSE_VECTOR_STATS)) {
out.writeOptionalWriteable(denseVectorStats);
}
if (out.getTransportVersion().onOrAfter(VERSION_SUPPORTING_SPARSE_VECTOR_STATS)) {
out.writeOptionalWriteable(sparseVectorStats);
}
out.writeOptionalWriteable(sparseVectorStats);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.RamUsageEstimator;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.replication.ReplicatedWriteRequest;
Expand Down Expand Up @@ -44,11 +43,7 @@ public final class BulkShardRequest extends ReplicatedWriteRequest<BulkShardRequ
public BulkShardRequest(StreamInput in) throws IOException {
super(in);
items = in.readArray(i -> i.readOptionalWriteable(inpt -> new BulkItemRequest(shardId, inpt)), BulkItemRequest[]::new);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
isSimulated = in.readBoolean();
} else {
isSimulated = false;
}
isSimulated = in.readBoolean();
}

public BulkShardRequest(
Expand Down Expand Up @@ -166,9 +161,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
super.writeTo(out);
out.writeArray((o, item) -> o.writeOptional(BulkItemRequest.THIN_WRITER, item), items);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeBoolean(isSimulated);
}
out.writeBoolean(isSimulated);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.action.datastreams.lifecycle;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.admin.indices.rollover.RolloverConfiguration;
import org.elasticsearch.cluster.metadata.DataStreamGlobalRetention;
import org.elasticsearch.cluster.metadata.DataStreamLifecycle;
Expand Down Expand Up @@ -82,11 +81,7 @@ public ExplainIndexDataStreamLifecycle(
public ExplainIndexDataStreamLifecycle(StreamInput in) throws IOException {
this.index = in.readString();
this.managedByLifecycle = in.readBoolean();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
this.isInternalDataStream = in.readBoolean();
} else {
this.isInternalDataStream = false;
}
this.isInternalDataStream = in.readBoolean();
if (managedByLifecycle) {
this.indexCreationDate = in.readOptionalLong();
this.rolloverDate = in.readOptionalLong();
Expand Down Expand Up @@ -165,9 +160,7 @@ public XContentBuilder toXContent(
public void writeTo(StreamOutput out) throws IOException {
out.writeString(index);
out.writeBoolean(managedByLifecycle);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeBoolean(isInternalDataStream);
}
out.writeBoolean(isInternalDataStream);
if (managedByLifecycle) {
out.writeOptionalLong(indexCreationDate);
out.writeOptionalLong(rolloverDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,7 @@ public record DataStreamLifecycle(
public void writeTo(StreamOutput out) throws IOException {
out.writeString(dataStreamName);
out.writeOptionalWriteable(lifecycle);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeBoolean(isInternalDataStream);
}
out.writeBoolean(isInternalDataStream);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.bulk.IndexDocFailureStoreStatus;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.common.bytes.BytesReference;
Expand Down Expand Up @@ -53,11 +52,7 @@ public SimulateIndexResponse(StreamInput in) throws IOException {
this.source = in.readBytesReference();
this.sourceXContentType = XContentType.valueOf(in.readString());
setShardInfo(ShardInfo.EMPTY);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
this.exception = in.readException();
} else {
this.exception = null;
}
this.exception = in.readException();
this.ignoredFields = in.readStringCollectionAsList();
if (in.getTransportVersion().supports(SIMULATE_INGEST_EFFECTIVE_MAPPING)) {
if (in.readBoolean()) {
Expand Down Expand Up @@ -145,9 +140,7 @@ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBytesReference(source);
out.writeString(sourceXContentType.name());
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeException(exception);
}
out.writeException(exception);
out.writeStringCollection(ignoredFields);
if (out.getTransportVersion().supports(SIMULATE_INGEST_EFFECTIVE_MAPPING)) {
out.writeBoolean(effectiveMapping != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.action.support.local;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.TransportAction;
Expand Down Expand Up @@ -55,9 +54,7 @@ protected LocalClusterStateRequest(StreamInput in) throws IOException {
protected LocalClusterStateRequest(StreamInput in, boolean readLocal) throws IOException {
super(in);
masterTimeout = in.readTimeValue();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
in.readVLong();
}
in.readVLong();
if (readLocal) {
in.readBoolean();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.action.support.master;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
Expand Down Expand Up @@ -79,11 +78,7 @@ protected MasterNodeRequest(TimeValue masterNodeTimeout) {
protected MasterNodeRequest(StreamInput in) throws IOException {
super(in);
masterNodeTimeout = in.readTimeValue();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
masterTerm = in.readVLong();
} else {
masterTerm = 0L;
}
masterTerm = in.readVLong();
}

@Override
Expand All @@ -93,9 +88,7 @@ public void writeTo(StreamOutput out) throws IOException {
assert masterTerm <= newMasterTerm : masterTerm + " vs " + newMasterTerm;
super.writeTo(out);
out.writeTimeValue(masterNodeTimeout);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
out.writeVLong(newMasterTerm);
} // else no protection against routing loops in older versions
out.writeVLong(newMasterTerm);
}

private long getNewMasterTerm(StreamOutput out) {
Expand Down
Loading