public class TruncateTranslogCommand extends EnvironmentAwareCommand
description, parser
Constructor and Description |
---|
TruncateTranslogCommand() |
Modifier and Type | Method and Description |
---|---|
protected void |
execute(Terminal terminal,
joptsimple.OptionSet options,
Environment env)
Execute the command with the initialized
Environment . |
static java.util.Set<java.nio.file.Path> |
filesInDirectory(java.nio.file.Path directory)
Return a Set of all files in a given directory
|
joptsimple.OptionParser |
getParser() |
protected void |
printAdditionalHelp(Terminal terminal) |
static void |
warnAboutDeletingFiles(Terminal terminal,
java.util.Set<java.nio.file.Path> files,
boolean batchMode)
Show a warning about deleting files, asking for a confirmation if
batchMode is false |
static void |
writeEmptyCheckpoint(java.nio.file.Path filename,
int translogLength,
long translogGeneration)
Write a checkpoint file to the given location with the given generation
|
static int |
writeEmptyTranslog(java.nio.file.Path filename,
java.lang.String translogUUID)
Write a translog containing the given translog UUID to the given location.
|
createEnv, execute
addShutdownHook, close, exit, main
public joptsimple.OptionParser getParser()
protected void printAdditionalHelp(Terminal terminal)
printAdditionalHelp
in class Command
protected void execute(Terminal terminal, joptsimple.OptionSet options, Environment env) throws java.lang.Exception
EnvironmentAwareCommand
Environment
.execute
in class EnvironmentAwareCommand
java.lang.Exception
public static void writeEmptyCheckpoint(java.nio.file.Path filename, int translogLength, long translogGeneration) throws java.io.IOException
java.io.IOException
public static int writeEmptyTranslog(java.nio.file.Path filename, java.lang.String translogUUID) throws java.io.IOException
java.io.IOException
public static void warnAboutDeletingFiles(Terminal terminal, java.util.Set<java.nio.file.Path> files, boolean batchMode)
batchMode
is falsepublic static java.util.Set<java.nio.file.Path> filesInDirectory(java.nio.file.Path directory) throws java.io.IOException
java.io.IOException