Tidy up some ILM and SLM packages (#63146)
Very minor refactoring, just moving some ILM and SLM classes around to decrease the total number of packages.
This commit is contained in:
parent
300e525138
commit
d172a18c95
|
@ -13,7 +13,6 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.xpack.core.XPackFeatureSet;
|
||||
import org.elasticsearch.xpack.core.XPackField;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.common.xcontent.ConstructingObjectParser;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin.XPackMetadataCustom;
|
||||
import org.elasticsearch.xpack.core.ilm.OperationMode;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.common.xcontent.ToXContentFragment;
|
|||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.snapshots.SnapshotId;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.xpack.slm;
|
||||
package org.elasticsearch.xpack.core.slm;
|
||||
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.Strings;
|
||||
|
@ -79,8 +79,8 @@ public class SnapshotLifecycleStats implements Writeable, ToXContentObject {
|
|||
this.policyStats = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
// Package visible for testing
|
||||
SnapshotLifecycleStats(long retentionRuns, long retentionFailed, long retentionTimedOut, long retentionTimeMs,
|
||||
// public for testing
|
||||
public SnapshotLifecycleStats(long retentionRuns, long retentionFailed, long retentionTimedOut, long retentionTimeMs,
|
||||
Map<String, SnapshotPolicyStats> policyStats) {
|
||||
this.retentionRunCount.inc(retentionRuns);
|
||||
this.retentionFailedCount.inc(retentionFailed);
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.common.io.stream.StreamInput;
|
|||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.elasticsearch.common.io.stream.Writeable;
|
|||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.AbstractSerializingTestCase;
|
||||
import org.elasticsearch.xpack.core.ilm.OperationMode;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStatsTests;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.elasticsearch.common.io.stream.Writeable;
|
|||
import org.elasticsearch.snapshots.SnapshotId;
|
||||
import org.elasticsearch.test.AbstractWireSerializingTestCase;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStatsTests;
|
||||
|
||||
import static org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadataTests.randomSnapshotLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadataTests.createRandomPolicyMetadata;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.xpack.slm;
|
||||
package org.elasticsearch.xpack.core.slm;
|
||||
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.xpack.slm;
|
||||
package org.elasticsearch.xpack.core.slm;
|
||||
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
|
@ -13,8 +13,6 @@ import org.elasticsearch.snapshots.SnapshotInfo;
|
|||
import org.elasticsearch.snapshots.SnapshotShardFailure;
|
||||
import org.elasticsearch.snapshots.SnapshotState;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotRetentionConfiguration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
|
@ -35,6 +35,7 @@ import org.elasticsearch.xpack.core.ilm.LifecycleSettings;
|
|||
import org.elasticsearch.xpack.core.ilm.Step;
|
||||
import org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotRetentionConfiguration;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -67,7 +67,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF
|
|||
import static org.elasticsearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS;
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.newLockableLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.newLockableLifecyclePolicy;
|
||||
import static org.hamcrest.CoreMatchers.not;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.elasticsearch.xpack.core.scheduler.SchedulerEngine;
|
|||
import org.elasticsearch.xpack.core.slm.SnapshotInvocationRecord;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryItem;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryStore;
|
||||
import org.elasticsearch.xpack.ilm.LifecyclePolicySecurityClient;
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.elasticsearch.xpack.core.ilm.LifecycleSettings;
|
|||
import org.elasticsearch.xpack.core.scheduler.SchedulerEngine;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotRetentionConfiguration;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryItem;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryStore;
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.elasticsearch.cluster.ClusterState;
|
|||
import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||
import org.elasticsearch.cluster.metadata.Metadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
|
||||
/**
|
||||
* {@link UpdateSnapshotLifecycleStatsTask} is a cluster state update task that retrieves the
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
|||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyItem;
|
||||
import org.elasticsearch.xpack.core.slm.action.GetSnapshotLifecycleAction;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.action.GetSnapshotLifecycleStatsAction;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
|||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.action.PutSnapshotLifecycleAction;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleService;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
|
|
|
@ -47,7 +47,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
|
|
@ -49,8 +49,8 @@ import java.util.Map;
|
|||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.randomTimeseriesLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.randomTimeseriesLifecyclePolicy;
|
||||
|
||||
public class IndexLifecycleMetadataTests extends AbstractDiffableSerializationTestCase<Metadata.Custom> {
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ import java.util.function.BiFunction;
|
|||
import static java.util.stream.Collectors.toList;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.awaitLatch;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
|
|
@ -61,7 +61,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import static org.elasticsearch.xpack.core.ilm.AbstractStepTestCase.randomStepKey;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
|
|
|
@ -47,7 +47,7 @@ import java.util.function.Function;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY;
|
||||
import static org.elasticsearch.xpack.core.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.LifecyclePolicyTestsUtils.newTestLifecyclePolicy;
|
||||
import static org.elasticsearch.xpack.ilm.IndexLifecycleRunnerTests.createOneStepPolicyStepRegistry;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
|
|
@ -3,9 +3,14 @@
|
|||
* 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.ilm;
|
||||
package org.elasticsearch.xpack.ilm;
|
||||
|
||||
import org.elasticsearch.xpack.ilm.LockableLifecycleType;
|
||||
import org.elasticsearch.xpack.core.ilm.LifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.ilm.LifecyclePolicyTests;
|
||||
import org.elasticsearch.xpack.core.ilm.LifecycleType;
|
||||
import org.elasticsearch.xpack.core.ilm.Phase;
|
||||
import org.elasticsearch.xpack.core.ilm.TestLifecycleType;
|
||||
import org.elasticsearch.xpack.core.ilm.TimeseriesLifecycleType;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.test.ESTestCase;
|
|||
import org.elasticsearch.xpack.core.ilm.IndexLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.ilm.OperationMode;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.elasticsearch.xpack.core.scheduler.SchedulerEngine;
|
|||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotRetentionConfiguration;
|
||||
import org.elasticsearch.xpack.core.watcher.watch.ClockMock;
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.elasticsearch.xpack.core.scheduler.SchedulerEngine;
|
|||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryItem;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryStore;
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ import org.elasticsearch.xpack.core.scheduler.SchedulerEngine;
|
|||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicyMetadata;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotRetentionConfiguration;
|
||||
import org.elasticsearch.xpack.core.slm.history.SnapshotHistoryStore;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.elasticsearch.test.StreamsUtils;
|
|||
import org.elasticsearch.test.rest.ESRestTestCase;
|
||||
import org.elasticsearch.upgrades.AbstractFullClusterRestartTestCase;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecyclePolicy;
|
||||
import org.elasticsearch.xpack.slm.SnapshotLifecycleStats;
|
||||
import org.elasticsearch.xpack.core.slm.SnapshotLifecycleStats;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.junit.Before;
|
||||
|
||||
|
|
Loading…
Reference in New Issue