Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ static class AdminOpts extends ServerUtilOpts {
boolean force = false;
}

@Parameters(commandDescription = "Compaction Temp Files Utility")
static class FindCompactionTmpFilesCommand {
@Parameter(names = "--tables", description = "comma separated list of table names")
String tables;

@Parameter(names = "--delete", description = "if true, will delete tmp files")
boolean delete = false;
}

@Parameters(commandDescription = "stop the tablet server on the given hosts")
static class StopCommand {
@Parameter(description = "<host> {<host> ... }")
Expand Down Expand Up @@ -321,6 +330,9 @@ public void execute(final String[] args) {
VolumesCommand volumesCommand = new VolumesCommand();
cl.addCommand("volumes", volumesCommand);

FindCompactionTmpFilesCommand filesCommand = new FindCompactionTmpFilesCommand();
cl.addCommand("compactionTempFiles", filesCommand);

cl.parse(args);

if (opts.help || cl.getParsedCommand() == null) {
Expand Down Expand Up @@ -385,6 +397,12 @@ public void execute(final String[] args) {
tServerLocksOpts.delete);
} else if (cl.getParsedCommand().equals("fate")) {
executeFateOpsCommand(context, fateOpsCommand);
} else if (cl.getParsedCommand().equals("compactionTempFiles")) {
if (filesCommand.delete) {
FindCompactionTmpFiles.main(new String[] {filesCommand.tables, "--delete"});
} else {
FindCompactionTmpFiles.main(new String[] {filesCommand.tables});
}
} else {
everything = cl.getParsedCommand().equals("stopAll");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ public void testAdminOpts() {
Admin.AdminOpts opts = new Admin.AdminOpts();
assertFalse(opts.force);
}

@Test
public void testFindCompactionTmpFilesCommand() {
Admin.FindCompactionTmpFilesCommand filesCommand = new Admin.FindCompactionTmpFilesCommand();
assertNull(filesCommand.tables);
assertFalse(filesCommand.delete);
}
}