Removes warnings from ILM code

This commit is contained in:
Colin Goodheart-Smithe 2018-06-14 13:42:12 +01:00
parent ce38127a16
commit d794253fc5
No known key found for this signature in database
GPG Key ID: F975E7BDD739B3C7
4 changed files with 8 additions and 13 deletions

View File

@ -10,7 +10,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContentObject;

View File

@ -10,8 +10,6 @@ import org.elasticsearch.action.Action;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.IndicesOptions.Option;
import org.elasticsearch.action.support.IndicesOptions.WildcardStates;
import org.elasticsearch.action.support.master.AcknowledgedRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.Strings;
@ -21,7 +19,6 @@ import org.elasticsearch.common.xcontent.ToXContentObject;
import java.io.IOException;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.Objects;
public class RetryAction extends Action<RetryAction.Request, RetryAction.Response> {

View File

@ -15,13 +15,10 @@ import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.Index;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.core.indexlifecycle.LifecyclePolicy;
import org.elasticsearch.xpack.core.indexlifecycle.LifecycleSettings;
import org.elasticsearch.xpack.core.indexlifecycle.MockStep;
import org.elasticsearch.xpack.core.indexlifecycle.Phase;
import org.elasticsearch.xpack.core.indexlifecycle.Step;
import org.elasticsearch.xpack.core.indexlifecycle.Step.StepKey;
import org.elasticsearch.xpack.core.indexlifecycle.TestLifecycleType;
import org.junit.Before;
import java.util.Collections;
@ -29,8 +26,6 @@ import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.sameInstance;
import static org.mockito.Mockito.mock;
public class MoveToNextStepUpdateTaskTests extends ESTestCase {

View File

@ -7,6 +7,7 @@ package org.elasticsearch.xpack.indexlifecycle;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.elasticsearch.client.Request;
import org.elasticsearch.cluster.metadata.IndexMetaData;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.Settings;
@ -28,7 +29,6 @@ import org.elasticsearch.xpack.core.indexlifecycle.TimeseriesLifecycleType;
import org.junit.Before;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@ -88,8 +88,10 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
createIndexWithSettings(index, Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1)
.put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0));
for (int i = 0; i < randomIntBetween(2, 10); i++) {
client().performRequest("PUT", index + "/_doc/" + i, singletonMap("refresh", "true"),
new StringEntity("{\"a\": \"test\"}", ContentType.APPLICATION_JSON));
Request request = new Request("PUT", index + "/_doc/" + i);
request.addParameter("refresh", "true");
request.setEntity(new StringEntity("{\"a\": \"test\"}", ContentType.APPLICATION_JSON));
client().performRequest(request);
}
Supplier<Integer> numSegments = () -> {
@ -139,7 +141,9 @@ public class TimeSeriesLifecycleActionsIT extends ESRestTestCase {
lifecyclePolicy.toXContent(builder, null);
final StringEntity entity = new StringEntity(
"{ \"policy\":" + Strings.toString(builder) + "}", ContentType.APPLICATION_JSON);
client().performRequest("PUT", "_xpack/index_lifecycle/" + policy, Collections.emptyMap(), entity);
Request request = new Request("PUT", "_xpack/index_lifecycle/" + policy);
request.setEntity(entity);
client().performRequest(request);
}
private void createIndexWithSettings(String index, Settings.Builder settings) throws IOException {