Removes unused and unneeded code

Various classes had some code that was not used and is not going to be needed so this change cleans up those classes so we don’t have dead code hanging around
This commit is contained in:
Colin Goodheart-Smithe 2018-04-10 09:28:03 +01:00
parent b8d573772f
commit c24dc07346
6 changed files with 0 additions and 82 deletions

View File

@ -16,8 +16,4 @@ public abstract class ClusterStateActionStep extends Step {
public abstract ClusterState performAction(Index index, ClusterState clusterState);
public boolean indexSurvives() {
return true;
}
}

View File

@ -5,12 +5,10 @@
*/
package org.elasticsearch.xpack.core.indexlifecycle;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
@ -25,7 +23,6 @@ import java.util.List;
public class DeleteAction implements LifecycleAction {
public static final String NAME = "delete";
private static final Logger logger = ESLoggerFactory.getLogger(DeleteAction.class);
private static final ObjectParser<DeleteAction, Void> PARSER = new ObjectParser<>(NAME, DeleteAction::new);
public static DeleteAction parse(XContentParser parser) {

View File

@ -9,7 +9,6 @@ import org.elasticsearch.client.Client;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
@ -17,7 +16,6 @@ import org.elasticsearch.common.xcontent.XContentParser;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* A {@link LifecycleAction} which force-merges the index.

View File

@ -1,49 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
package org.elasticsearch.xpack.core.indexlifecycle;
import org.elasticsearch.cluster.ClusterState;
public class StepResult {
private final String message;
private final Exception exception;
private final ClusterState clusterState;
private final boolean complete;
private final boolean indexSurvived;
public StepResult(String message, Exception exception, ClusterState clusterState, boolean indexSurvived, boolean complete) {
this.message = message;
this.exception = exception;
this.clusterState = clusterState;
this.indexSurvived = indexSurvived;
this.complete = complete;
}
public StepResult(StepResult result, ClusterState newClusterState) {
this(result.getMessage(), result.getException(), newClusterState, result.indexSurvived(), result.isComplete());
}
public String getMessage() {
return message;
}
public Exception getException() {
return exception;
}
public ClusterState getClusterState() {
return clusterState;
}
public boolean indexSurvived() {
return indexSurvived;
}
public boolean isComplete() {
return complete;
}
}

View File

@ -6,8 +6,6 @@
package org.elasticsearch.xpack.core.indexlifecycle;
import com.carrotsearch.randomizedtesting.annotations.Repeat;
import org.elasticsearch.Version;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState;
@ -18,7 +16,6 @@ import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.EqualsHashCodeTestUtils;
import org.elasticsearch.xpack.core.indexlifecycle.Step.StepKey;
@Repeat(iterations = 1000, useConstantSeed = false)
public class UpdateReplicaSettingsStepTests extends ESTestCase {
public UpdateReplicaSettingsStep createRandomInstance() {

View File

@ -5,7 +5,6 @@
*/
package org.elasticsearch.xpack.indexlifecycle;
import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.Diff;
@ -13,11 +12,9 @@ import org.elasticsearch.cluster.DiffableUtils;
import org.elasticsearch.xpack.core.indexlifecycle.LifecyclePolicy;
import org.elasticsearch.xpack.core.indexlifecycle.Step;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.function.LongSupplier;
@ -109,22 +106,4 @@ public class PolicyStepsRegistry {
return firstStepMap.get(policy);
}
@Override
public int hashCode() {
return Objects.hash(lifecyclePolicyMap, firstStepMap, stepMap);
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
PolicyStepsRegistry other = (PolicyStepsRegistry) obj;
return Objects.equals(lifecyclePolicyMap, other.lifecyclePolicyMap)
&& Objects.equals(firstStepMap, other.firstStepMap) && Objects.equals(stepMap, other.stepMap);
}
}