fix shrunken index source name metadata usage

This commit is contained in:
Tal Levy 2018-08-30 15:29:04 -07:00
parent 13a0d822d0
commit 4a958ee2bc
2 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@ public class ShrunkenIndexCheckStep extends ClusterStateWaitStep {
@Override
public Result isConditionMet(Index index, ClusterState clusterState) {
String shrunkenIndexSource = IndexMetaData.INDEX_SHRINK_SOURCE_NAME.get(
String shrunkenIndexSource = IndexMetaData.INDEX_RESIZE_SOURCE_NAME.get(
clusterState.metaData().index(index).getSettings());
if (Strings.isNullOrEmpty(shrunkenIndexSource)) {
throw new IllegalStateException("step[" + NAME + "] is checking an un-shrunken index[" + index.getName() + "]");

View File

@ -55,7 +55,7 @@ public class ShrunkenIndexCheckStepTests extends AbstractStepTestCase<ShrunkenIn
ShrunkenIndexCheckStep step = createRandomInstance();
String sourceIndex = randomAlphaOfLengthBetween(1, 10);
IndexMetaData indexMetadata = IndexMetaData.builder(step.getShrunkIndexPrefix() + sourceIndex)
.settings(settings(Version.CURRENT).put(IndexMetaData.INDEX_SHRINK_SOURCE_NAME_KEY, sourceIndex))
.settings(settings(Version.CURRENT).put(IndexMetaData.INDEX_RESIZE_SOURCE_NAME_KEY, sourceIndex))
.numberOfShards(1)
.numberOfReplicas(0).build();
MetaData metaData = MetaData.builder()
@ -73,7 +73,7 @@ public class ShrunkenIndexCheckStepTests extends AbstractStepTestCase<ShrunkenIn
ShrunkenIndexCheckStep step = createRandomInstance();
String sourceIndex = randomAlphaOfLengthBetween(1, 10);
IndexMetaData shrinkIndexMetadata = IndexMetaData.builder(sourceIndex + "hello")
.settings(settings(Version.CURRENT).put(IndexMetaData.INDEX_SHRINK_SOURCE_NAME_KEY, sourceIndex))
.settings(settings(Version.CURRENT).put(IndexMetaData.INDEX_RESIZE_SOURCE_NAME_KEY, sourceIndex))
.numberOfShards(1)
.numberOfReplicas(0).build();
MetaData metaData = MetaData.builder()
@ -94,7 +94,7 @@ public class ShrunkenIndexCheckStepTests extends AbstractStepTestCase<ShrunkenIn
.numberOfShards(100)
.numberOfReplicas(0).build();
IndexMetaData shrinkIndexMetadata = IndexMetaData.builder(step.getShrunkIndexPrefix() + sourceIndex)
.settings(settings(Version.CURRENT).put(IndexMetaData.INDEX_SHRINK_SOURCE_NAME_KEY, sourceIndex))
.settings(settings(Version.CURRENT).put(IndexMetaData.INDEX_RESIZE_SOURCE_NAME_KEY, sourceIndex))
.numberOfShards(1)
.numberOfReplicas(0).build();
MetaData metaData = MetaData.builder()