Internal: remove some more bwc code

Some more code that was left for backwards compatibility can now be removed on master since 2.0 will require a full cluster restart.

Closes #8778
This commit is contained in:
javanna 2014-12-04 12:41:53 +01:00 committed by Luca Cavanna
parent 5f329bd607
commit 95c2d844a9
6 changed files with 4 additions and 53 deletions

View File

@ -80,7 +80,7 @@ public class TransportGetIndexAction extends TransportClusterInfoAction<GetIndex
ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappingsResult = ImmutableOpenMap.of();
ImmutableOpenMap<String, ImmutableList<AliasMetaData>> aliasesResult = ImmutableOpenMap.of();
ImmutableOpenMap<String, Settings> settings = ImmutableOpenMap.of();
Feature[] features = request.featuresAsEnums();
Feature[] features = request.features();
boolean doneAliases = false;
boolean doneMappings = false;
boolean doneSettings = false;

View File

@ -23,11 +23,9 @@ import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.master.MasterNodeOperationRequest;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
@ -49,15 +47,6 @@ public class GetFieldMappingsRequest extends ActionRequest<GetFieldMappingsReque
}
public GetFieldMappingsRequest(GetFieldMappingsRequest other) {
this.local = other.local;
this.includeDefaults = other.includeDefaults;
this.indices = other.indices;
this.types = other.types;
this.indicesOptions = other.indicesOptions;
this.fields = other.fields;
}
/**
* Indicate whether the receiving node should operate based on local index information or forward requests,
* where needed, to other nodes. If running locally, request will not raise errors if running locally & missing indices.
@ -129,8 +118,6 @@ public class GetFieldMappingsRequest extends ActionRequest<GetFieldMappingsReque
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
// This request used to inherit from MasterNodeOperationRequest, so for bwc we need to keep serializing it.
MasterNodeOperationRequest.DEFAULT_MASTER_NODE_TIMEOUT.writeTo(out);
out.writeStringArray(indices);
out.writeStringArray(types);
indicesOptions.writeIndicesOptions(out);
@ -142,8 +129,6 @@ public class GetFieldMappingsRequest extends ActionRequest<GetFieldMappingsReque
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
// This request used to inherit from MasterNodeOperationRequest, so for bwc we need to keep serializing it.
TimeValue.readTimeValue(in);
indices = in.readStringArray();
types = in.readStringArray();
indicesOptions = IndicesOptions.readIndicesOptions(in);

View File

@ -19,7 +19,6 @@
package org.elasticsearch.action.search;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.common.io.stream.StreamInput;
@ -100,9 +99,6 @@ public class SearchScrollRequest extends ActionRequest<SearchScrollRequest> {
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
if (in.getVersion().before(Version.V_1_2_0)) {
in.readByte(); // backward comp. for operation threading
}
scrollId = in.readString();
if (in.readBoolean()) {
scroll = readScroll(in);
@ -112,9 +108,6 @@ public class SearchScrollRequest extends ActionRequest<SearchScrollRequest> {
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getVersion().before(Version.V_1_2_0)) {
out.writeByte((byte) 2); // operation threading
}
out.writeString(scrollId);
if (scroll == null) {
out.writeBoolean(false);

View File

@ -19,7 +19,6 @@
package org.elasticsearch.action.support.broadcast;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
@ -89,9 +88,6 @@ public abstract class BroadcastOperationRequest<T extends BroadcastOperationRequ
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeStringArrayNullable(indices);
if (out.getVersion().before(Version.V_1_2_0)) {
out.writeByte((byte) 2); // bwc operation threading
}
indicesOptions.writeIndicesOptions(out);
}
@ -99,9 +95,6 @@ public abstract class BroadcastOperationRequest<T extends BroadcastOperationRequ
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = in.readStringArray();
if (in.getVersion().before(Version.V_1_2_0)) {
in.readByte(); // bwc operation threading
}
indicesOptions = IndicesOptions.readIndicesOptions(in);
}
}

View File

@ -50,12 +50,6 @@ public class ZenPingService extends AbstractLifecycleComponent<ZenPing> implemen
private volatile ImmutableList<? extends ZenPing> zenPings = ImmutableList.of();
// here for backward comp. with discovery plugins
public ZenPingService(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterName clusterName, NetworkService networkService,
ElectMasterService electMasterService, @Nullable Set<UnicastHostsProvider> unicastHostsProviders) {
this(settings, threadPool, transportService, clusterName, networkService, Version.CURRENT, electMasterService, unicastHostsProviders);
}
@Inject
public ZenPingService(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterName clusterName, NetworkService networkService,
Version version, ElectMasterService electMasterService, @Nullable Set<UnicastHostsProvider> unicastHostsProviders) {
@ -74,19 +68,6 @@ public class ZenPingService extends AbstractLifecycleComponent<ZenPing> implemen
return this.zenPings;
}
public void zenPings(ImmutableList<? extends ZenPing> pings) {
this.zenPings = pings;
if (lifecycle.started()) {
for (ZenPing zenPing : zenPings) {
zenPing.start();
}
} else if (lifecycle.stopped()) {
for (ZenPing zenPing : zenPings) {
zenPing.stop();
}
}
}
@Override
public void setPingContextProvider(PingContextProvider contextProvider) {
if (lifecycle.started()) {

View File

@ -106,10 +106,9 @@ public class RestExplainAction extends BaseRestHandler {
@Override
public RestResponse buildResponse(ExplainResponse response, XContentBuilder builder) throws Exception {
builder.startObject();
//null checks for bw comp, since we only added in 1.4 index, type and id to ExplainResponse
builder.field(Fields._INDEX, response.getIndex() != null ? response.getIndex() : explainRequest.index())
.field(Fields._TYPE, response.getType() != null ? response.getType() : explainRequest.type())
.field(Fields._ID, response.getId() != null ? response.getId() : explainRequest.id())
builder.field(Fields._INDEX, response.getIndex())
.field(Fields._TYPE, response.getType())
.field(Fields._ID, response.getId())
.field(Fields.MATCHED, response.isMatch());
if (response.hasExplanation()) {