Package org.opensearch.index.shard
Class RemoveCorruptedShardDataCommand
java.lang.Object
org.opensearch.cli.Command
org.opensearch.cli.EnvironmentAwareCommand
org.opensearch.cluster.coordination.OpenSearchNodeCommand
org.opensearch.index.shard.RemoveCorruptedShardDataCommand
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RemoveCorruptedShardDataCommand extends OpenSearchNodeCommand
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RemoveCorruptedShardDataCommand.CleanStatus
Nested classes/interfaces inherited from class org.opensearch.cluster.coordination.OpenSearchNodeCommand
OpenSearchNodeCommand.UnknownCondition, OpenSearchNodeCommand.UnknownMetadataCustom
-
Field Summary
Fields inherited from class org.opensearch.cluster.coordination.OpenSearchNodeCommand
ABORTED_BY_USER_MSG, CS_MISSING_MSG, DELIMITER, FAILED_TO_OBTAIN_NODE_LOCK_MSG, namedXContentRegistry
-
Constructor Summary
Constructors Constructor Description RemoveCorruptedShardDataCommand()
-
Method Summary
Modifier and Type Method Description protected void
addNewHistoryCommit(org.apache.lucene.store.Directory indexDirectory, org.opensearch.cli.Terminal terminal, boolean updateLocalCheckpoint)
protected void
dropCorruptMarkerFiles(org.opensearch.cli.Terminal terminal, java.nio.file.Path path, org.apache.lucene.store.Directory directory, boolean clean)
protected void
findAndProcessShardPath(joptsimple.OptionSet options, Environment environment, java.nio.file.Path[] dataPaths, int nodeLockId, ClusterState clusterState, org.opensearch.common.CheckedConsumer<ShardPath,java.io.IOException> consumer)
joptsimple.OptionParser
getParser()
protected java.nio.file.Path
getPath(java.lang.String dirValue)
static boolean
isCorruptMarkerFileIsPresent(org.apache.lucene.store.Directory directory)
protected void
printAdditionalHelp(org.opensearch.cli.Terminal terminal)
void
processNodePaths(org.opensearch.cli.Terminal terminal, java.nio.file.Path[] dataPaths, int nodeLockId, joptsimple.OptionSet options, Environment environment)
Process the paths.Methods inherited from class org.opensearch.cluster.coordination.OpenSearchNodeCommand
clusterState, confirm, createPersistedClusterStateService, execute, loadTermAndClusterState, processNodePaths, toNodePaths, validateBeforeLock
Methods inherited from class org.opensearch.cli.EnvironmentAwareCommand
createEnv, createEnv, execute
-
Constructor Details
-
RemoveCorruptedShardDataCommand
public RemoveCorruptedShardDataCommand()
-
-
Method Details
-
printAdditionalHelp
protected void printAdditionalHelp(org.opensearch.cli.Terminal terminal)- Overrides:
printAdditionalHelp
in classorg.opensearch.cli.Command
-
getParser
public joptsimple.OptionParser getParser() -
getPath
protected java.nio.file.Path getPath(java.lang.String dirValue) -
findAndProcessShardPath
protected void findAndProcessShardPath(joptsimple.OptionSet options, Environment environment, java.nio.file.Path[] dataPaths, int nodeLockId, ClusterState clusterState, org.opensearch.common.CheckedConsumer<ShardPath,java.io.IOException> consumer) throws java.io.IOException- Throws:
java.io.IOException
-
isCorruptMarkerFileIsPresent
public static boolean isCorruptMarkerFileIsPresent(org.apache.lucene.store.Directory directory) throws java.io.IOException- Throws:
java.io.IOException
-
dropCorruptMarkerFiles
protected void dropCorruptMarkerFiles(org.opensearch.cli.Terminal terminal, java.nio.file.Path path, org.apache.lucene.store.Directory directory, boolean clean) throws java.io.IOException- Throws:
java.io.IOException
-
processNodePaths
public void processNodePaths(org.opensearch.cli.Terminal terminal, java.nio.file.Path[] dataPaths, int nodeLockId, joptsimple.OptionSet options, Environment environment) throws java.io.IOExceptionDescription copied from class:OpenSearchNodeCommand
Process the paths. Locks for the paths is held during this method invocation.- Specified by:
processNodePaths
in classOpenSearchNodeCommand
- Parameters:
terminal
- the terminal to use for messagesdataPaths
- the paths of the node to processoptions
- the command line optionsenvironment
- the env of the node to process- Throws:
java.io.IOException
-
addNewHistoryCommit
protected void addNewHistoryCommit(org.apache.lucene.store.Directory indexDirectory, org.opensearch.cli.Terminal terminal, boolean updateLocalCheckpoint) throws java.io.IOException- Throws:
java.io.IOException
-