mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Ensure all Steps have Javadoc (#35757)
Adds or corrects Javadoc on subclasses of Step.
This commit is contained in:
parent
e179bd393d
commit
d9c6986b75
@ -32,6 +32,9 @@ import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Checks whether all shards have been correctly routed in response to an update to the allocation rules for an index.
|
||||
*/
|
||||
public class AllocationRoutedStep extends ClusterStateWaitStep {
|
||||
public static final String NAME = "check-allocation";
|
||||
|
||||
|
@ -9,6 +9,9 @@ import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
|
||||
/**
|
||||
* Performs an action which must be performed asynchronously because it may take time to complete.
|
||||
*/
|
||||
public abstract class AsyncActionStep extends Step {
|
||||
|
||||
private Client client;
|
||||
|
@ -9,6 +9,12 @@ import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
|
||||
/**
|
||||
* A step which will be called periodically, waiting for some condition to become true.
|
||||
* Called asynchronously, as the condition may take time to check.
|
||||
*
|
||||
* If checking something based on the current cluster state which does not take time to check, use {@link ClusterStateWaitStep}.
|
||||
*/
|
||||
public abstract class AsyncWaitStep extends Step {
|
||||
|
||||
private Client client;
|
||||
|
@ -8,6 +8,9 @@ package org.elasticsearch.xpack.core.indexlifecycle;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.index.Index;
|
||||
|
||||
/**
|
||||
* Updates the cluster state, similar to {@link org.elasticsearch.cluster.ClusterStateUpdateTask}.
|
||||
*/
|
||||
public abstract class ClusterStateActionStep extends Step {
|
||||
|
||||
public ClusterStateActionStep(StepKey key, StepKey nextStepKey) {
|
||||
|
@ -9,6 +9,11 @@ import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.common.xcontent.ToXContentObject;
|
||||
import org.elasticsearch.index.Index;
|
||||
|
||||
/**
|
||||
* Checks whether a condition has been met based on the cluster state.
|
||||
*
|
||||
* If checking a condition not based on the cluster state, or which may take time to evaluate, use {@link AsyncWaitStep}.
|
||||
*/
|
||||
public abstract class ClusterStateWaitStep extends Step {
|
||||
|
||||
public ClusterStateWaitStep(StepKey key, StepKey nextStepKey) {
|
||||
|
@ -11,6 +11,9 @@ import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
|
||||
/**
|
||||
* Deletes a single index.
|
||||
*/
|
||||
public class DeleteStep extends AsyncActionStep {
|
||||
public static final String NAME = "delete";
|
||||
|
||||
|
@ -5,6 +5,9 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.indexlifecycle;
|
||||
|
||||
/**
|
||||
* Signals that an error was encountered during the execution of a policy on an index.
|
||||
*/
|
||||
public class ErrorStep extends Step {
|
||||
public static final String NAME = "ERROR";
|
||||
|
||||
|
@ -13,6 +13,9 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Invokes a force merge on a single index.
|
||||
*/
|
||||
public class ForceMergeStep extends AsyncActionStep {
|
||||
public static final String NAME = "forcemerge";
|
||||
private final int maxNumSegments;
|
||||
|
@ -14,6 +14,9 @@ import org.elasticsearch.index.Index;
|
||||
|
||||
import static org.elasticsearch.xpack.core.indexlifecycle.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY;
|
||||
|
||||
/**
|
||||
* Initializes the {@link LifecycleExecutionState} for an index. This should be the first Step called on an index.
|
||||
*/
|
||||
public final class InitializePolicyContextStep extends ClusterStateActionStep {
|
||||
public static final String INITIALIZATION_PHASE = "new";
|
||||
public static final StepKey KEY = new StepKey(INITIALIZATION_PHASE, "init", "init");
|
||||
|
@ -21,7 +21,7 @@ import java.util.Objects;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
/**
|
||||
* This {@link Step} evaluates whether force_merge was successful
|
||||
* This {@link Step} evaluates whether force_merge was successful by checking the segment count.
|
||||
*/
|
||||
public class SegmentCountStep extends AsyncWaitStep {
|
||||
public static final String NAME = "segment-count";
|
||||
|
@ -27,6 +27,10 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Allocates all shards in a single index to one node.
|
||||
* For example, as preparation for shrinking that index.
|
||||
*/
|
||||
public class SetSingleNodeAllocateStep extends AsyncActionStep {
|
||||
public static final String NAME = "set-single-node-allocation";
|
||||
|
||||
|
@ -13,6 +13,10 @@ import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Following shrinking an index and deleting the original index, this step creates an alias with the same name as the original index which
|
||||
* points to the new shrunken index to allow clients to continue to use the original index name without being aware that it has shrunk.
|
||||
*/
|
||||
public class ShrinkSetAliasStep extends AsyncActionStep {
|
||||
public static final String NAME = "aliases";
|
||||
private String shrunkIndexPrefix;
|
||||
|
@ -15,6 +15,9 @@ import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Shrinks an index, using a prefix prepended to the original index name for the name of the shrunken index.
|
||||
*/
|
||||
public class ShrinkStep extends AsyncActionStep {
|
||||
public static final String NAME = "shrink";
|
||||
|
||||
|
@ -17,6 +17,9 @@ import org.elasticsearch.index.Index;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Checks whether all shards in a shrunken index have been successfully allocated.
|
||||
*/
|
||||
public class ShrunkShardsAllocatedStep extends ClusterStateWaitStep {
|
||||
public static final String NAME = "shrunk-shards-allocated";
|
||||
private String shrunkIndexPrefix;
|
||||
|
@ -19,6 +19,10 @@ import org.elasticsearch.index.Index;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Verifies that an index was created through a shrink operation, rather than created some other way.
|
||||
* Also checks the name of the index to ensure it aligns with what is expected from an index shrunken via a previous step.
|
||||
*/
|
||||
public class ShrunkenIndexCheckStep extends ClusterStateWaitStep {
|
||||
public static final String NAME = "is-shrunken-index";
|
||||
private static final Logger logger = LogManager.getLogger(InitializePolicyContextStep.class);
|
||||
|
@ -19,7 +19,7 @@ import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A {@link LifecycleAction} which deletes the index.
|
||||
* Represents one part of the execution of a {@link LifecycleAction}.
|
||||
*/
|
||||
public abstract class Step {
|
||||
private final StepKey key;
|
||||
|
@ -5,6 +5,9 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.core.indexlifecycle;
|
||||
|
||||
/**
|
||||
* Signals that the policy for an index has been fully executed.
|
||||
*/
|
||||
public class TerminalPolicyStep extends Step {
|
||||
public static final String COMPLETED_PHASE = "completed";
|
||||
public static final StepKey KEY = new StepKey(COMPLETED_PHASE, "completed", "completed");
|
||||
|
@ -14,6 +14,10 @@ import org.elasticsearch.index.Index;
|
||||
|
||||
import static org.elasticsearch.xpack.core.indexlifecycle.LifecycleExecutionState.ILM_CUSTOM_METADATA_KEY;
|
||||
|
||||
/**
|
||||
* Copies the lifecycle reference date to a new index created by rolling over an alias.
|
||||
* Used so that the "age" of an index doesn't get reset on rollover.
|
||||
*/
|
||||
public class UpdateRolloverLifecycleDateStep extends ClusterStateActionStep {
|
||||
public static final String NAME = "update-rollover-lifecycle-date";
|
||||
|
||||
|
@ -14,6 +14,9 @@ import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Updates the settings for an index.
|
||||
*/
|
||||
public class UpdateSettingsStep extends AsyncActionStep {
|
||||
public static final String NAME = "update-settings";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user