|
@@ -21,6 +21,7 @@ import org.elasticsearch.cluster.routing.ShardRoutingState;
|
|
|
import org.elasticsearch.cluster.routing.TestShardRouting;
|
|
|
import org.elasticsearch.index.shard.ShardId;
|
|
|
import org.elasticsearch.xpack.core.ilm.Step.StepKey;
|
|
|
+import org.elasticsearch.xpack.core.ilm.step.info.SingleMessageFieldInfo;
|
|
|
|
|
|
import java.util.function.BiFunction;
|
|
|
|
|
@@ -125,7 +126,7 @@ public class WaitForIndexColorStepTests extends AbstractStepTestCase<WaitForInde
|
|
|
WaitForIndexColorStep step = new WaitForIndexColorStep(randomStepKey(), randomStepKey(), ClusterHealthStatus.GREEN);
|
|
|
ClusterStateWaitStep.Result result = step.isConditionMet(indexMetadata.getIndex(), clusterState);
|
|
|
assertThat(result.isComplete(), is(false));
|
|
|
- WaitForIndexColorStep.Info info = (WaitForIndexColorStep.Info) result.getInfomationContext();
|
|
|
+ SingleMessageFieldInfo info = (SingleMessageFieldInfo) result.getInfomationContext();
|
|
|
assertThat(info, notNullValue());
|
|
|
assertThat(info.getMessage(), equalTo("index is not green; not all shards are active"));
|
|
|
}
|
|
@@ -145,7 +146,7 @@ public class WaitForIndexColorStepTests extends AbstractStepTestCase<WaitForInde
|
|
|
WaitForIndexColorStep step = new WaitForIndexColorStep(randomStepKey(), randomStepKey(), ClusterHealthStatus.YELLOW);
|
|
|
ClusterStateWaitStep.Result result = step.isConditionMet(indexMetadata.getIndex(), clusterState);
|
|
|
assertThat(result.isComplete(), is(false));
|
|
|
- WaitForIndexColorStep.Info info = (WaitForIndexColorStep.Info) result.getInfomationContext();
|
|
|
+ SingleMessageFieldInfo info = (SingleMessageFieldInfo) result.getInfomationContext();
|
|
|
assertThat(info, notNullValue());
|
|
|
assertThat(info.getMessage(), equalTo("index is red; no indexRoutingTable"));
|
|
|
}
|
|
@@ -199,7 +200,7 @@ public class WaitForIndexColorStepTests extends AbstractStepTestCase<WaitForInde
|
|
|
WaitForIndexColorStep step = new WaitForIndexColorStep(randomStepKey(), randomStepKey(), ClusterHealthStatus.YELLOW);
|
|
|
ClusterStateWaitStep.Result result = step.isConditionMet(indexMetadata.getIndex(), clusterState);
|
|
|
assertThat(result.isComplete(), is(false));
|
|
|
- WaitForIndexColorStep.Info info = (WaitForIndexColorStep.Info) result.getInfomationContext();
|
|
|
+ SingleMessageFieldInfo info = (SingleMessageFieldInfo) result.getInfomationContext();
|
|
|
assertThat(info, notNullValue());
|
|
|
assertThat(info.getMessage(), equalTo("index is red; not all primary shards are active"));
|
|
|
}
|
|
@@ -219,7 +220,7 @@ public class WaitForIndexColorStepTests extends AbstractStepTestCase<WaitForInde
|
|
|
WaitForIndexColorStep step = new WaitForIndexColorStep(randomStepKey(), randomStepKey(), ClusterHealthStatus.YELLOW);
|
|
|
ClusterStateWaitStep.Result result = step.isConditionMet(indexMetadata.getIndex(), clusterState);
|
|
|
assertThat(result.isComplete(), is(false));
|
|
|
- WaitForIndexColorStep.Info info = (WaitForIndexColorStep.Info) result.getInfomationContext();
|
|
|
+ SingleMessageFieldInfo info = (SingleMessageFieldInfo) result.getInfomationContext();
|
|
|
assertThat(info, notNullValue());
|
|
|
assertThat(info.getMessage(), equalTo("index is red; no indexRoutingTable"));
|
|
|
}
|
|
@@ -249,7 +250,7 @@ public class WaitForIndexColorStepTests extends AbstractStepTestCase<WaitForInde
|
|
|
WaitForIndexColorStep step = new WaitForIndexColorStep(randomStepKey(), randomStepKey(), ClusterHealthStatus.GREEN, indexPrefix);
|
|
|
ClusterStateWaitStep.Result result = step.isConditionMet(originalIndex.getIndex(), clusterState);
|
|
|
assertThat(result.isComplete(), is(false));
|
|
|
- WaitForIndexColorStep.Info info = (WaitForIndexColorStep.Info) result.getInfomationContext();
|
|
|
+ SingleMessageFieldInfo info = (SingleMessageFieldInfo) result.getInfomationContext();
|
|
|
String targetIndex = indexPrefix + originalIndex.getIndex().getName();
|
|
|
assertThat(
|
|
|
info.getMessage(),
|
|
@@ -309,7 +310,7 @@ public class WaitForIndexColorStepTests extends AbstractStepTestCase<WaitForInde
|
|
|
WaitForIndexColorStep step = new WaitForIndexColorStep(randomStepKey(), randomStepKey(), ClusterHealthStatus.GREEN);
|
|
|
ClusterStateWaitStep.Result result = step.isConditionMet(originalIndex.getIndex(), clusterTargetInitializing);
|
|
|
assertThat(result.isComplete(), is(false));
|
|
|
- WaitForIndexColorStep.Info info = (WaitForIndexColorStep.Info) result.getInfomationContext();
|
|
|
+ SingleMessageFieldInfo info = (SingleMessageFieldInfo) result.getInfomationContext();
|
|
|
assertThat(info.getMessage(), is("index is not green; not all shards are active"));
|
|
|
}
|
|
|
|