Browse Source

Remove IndexerState from HLRC (#92023)

Joe Gallo 2 years ago
parent
commit
4798f050e8

+ 0 - 47
client/rest-high-level/src/main/java/org/elasticsearch/client/core/IndexerState.java

@@ -1,47 +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
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-package org.elasticsearch.client.core;
-
-import java.util.Locale;
-
-/**
- * IndexerState represents the internal state of the indexer.  It
- * is also persistent when changing from started/stopped in case the allocated
- * task is restarted elsewhere.
- */
-public enum IndexerState {
-    /** Indexer is running, but not actively indexing data (e.g. it's idle). */
-    STARTED,
-
-    /** Indexer is actively indexing data. */
-    INDEXING,
-
-    /**
-     * Transition state to where an indexer has acknowledged the stop
-     * but is still in process of halting.
-     */
-    STOPPING,
-
-    /** Indexer is "paused" and ignoring scheduled triggers. */
-    STOPPED,
-
-    /**
-     * Something (internal or external) has requested the indexer abort
-     * and shutdown.
-     */
-    ABORTING;
-
-    public static IndexerState fromString(String name) {
-        return valueOf(name.trim().toUpperCase(Locale.ROOT));
-    }
-
-    public String value() {
-        return name().toLowerCase(Locale.ROOT);
-    }
-}

+ 1 - 0
x-pack/qa/rolling-upgrade/build.gradle

@@ -8,6 +8,7 @@ apply plugin: 'elasticsearch.bwc-test'
 apply plugin: 'elasticsearch.rest-resources'
 
 dependencies {
+  testImplementation testArtifact(project(xpackModule('core')))
   testImplementation project(':x-pack:qa')
   testImplementation project(':client:rest-high-level')
 }

+ 1 - 1
x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/TransformSurvivesUpgradeIT.java

@@ -14,13 +14,13 @@ import org.elasticsearch.client.Request;
 import org.elasticsearch.client.Response;
 import org.elasticsearch.client.RestClient;
 import org.elasticsearch.client.RestClientBuilder;
-import org.elasticsearch.client.core.IndexerState;
 import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.support.XContentMapValues;
 import org.elasticsearch.core.Booleans;
 import org.elasticsearch.core.TimeValue;
 import org.elasticsearch.xcontent.XContentBuilder;
+import org.elasticsearch.xpack.core.indexing.IndexerState;
 
 import java.io.IOException;
 import java.time.Instant;