Package org.elasticsearch.index.shard
Class RemoveCorruptedShardDataCommand
- java.lang.Object
-
- org.elasticsearch.cli.Command
-
- org.elasticsearch.cli.EnvironmentAwareCommand
-
- org.elasticsearch.index.shard.RemoveCorruptedShardDataCommand
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RemoveCorruptedShardDataCommand extends EnvironmentAwareCommand
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RemoveCorruptedShardDataCommand.CleanStatus
-
Field Summary
-
Fields inherited from class org.elasticsearch.cli.Command
description, parser
-
-
Constructor Summary
Constructors Constructor Description RemoveCorruptedShardDataCommand()
-
Method Summary
Modifier and Type Method Description protected void
addNewHistoryCommit(org.apache.lucene.store.Directory indexDirectory, Terminal terminal, boolean updateLocalCheckpoint)
protected void
dropCorruptMarkerFiles(Terminal terminal, java.nio.file.Path path, org.apache.lucene.store.Directory directory, boolean clean)
void
execute(Terminal terminal, joptsimple.OptionSet options, Environment environment)
Execute the command with the initializedEnvironment
.protected void
findAndProcessShardPath(joptsimple.OptionSet options, Environment environment, 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
newAllocationId(Environment environment, ShardPath shardPath, Terminal terminal)
protected void
printAdditionalHelp(Terminal terminal)
-
Methods inherited from class org.elasticsearch.cli.EnvironmentAwareCommand
createEnv, execute
-
Methods inherited from class org.elasticsearch.cli.Command
addShutdownHook, close, exit, main
-
-
-
-
Method Detail
-
printAdditionalHelp
protected void printAdditionalHelp(Terminal terminal)
- Overrides:
printAdditionalHelp
in classCommand
-
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, 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(Terminal terminal, java.nio.file.Path path, org.apache.lucene.store.Directory directory, boolean clean) throws java.io.IOException
- Throws:
java.io.IOException
-
execute
public void execute(Terminal terminal, joptsimple.OptionSet options, Environment environment) throws java.lang.Exception
Description copied from class:EnvironmentAwareCommand
Execute the command with the initializedEnvironment
.- Specified by:
execute
in classEnvironmentAwareCommand
- Throws:
java.lang.Exception
-
addNewHistoryCommit
protected void addNewHistoryCommit(org.apache.lucene.store.Directory indexDirectory, Terminal terminal, boolean updateLocalCheckpoint) throws java.io.IOException
- Throws:
java.io.IOException
-
newAllocationId
protected void newAllocationId(Environment environment, ShardPath shardPath, Terminal terminal) throws java.io.IOException
- Throws:
java.io.IOException
-
-