use of alluxio.cli.fsadmin.doctor.StorageCommand in project alluxio by Alluxio.
the class DoctorCommand method run.
@Override
public int run(CommandLine cl) throws IOException {
String[] args = cl.getArgs();
if (cl.hasOption(HELP_OPTION_NAME)) {
System.out.println(getUsage());
System.out.println(getDescription());
return 0;
}
FileSystemAdminShellUtils.checkMasterClientService(mConf);
// Get the doctor category
Command command = Command.ALL;
if (args.length == 1) {
switch(args[0]) {
case "configuration":
command = Command.CONFIGURATION;
break;
case "storage":
command = Command.STORAGE;
break;
default:
System.out.println(getUsage());
System.out.println(getDescription());
throw new InvalidArgumentException("doctor category is invalid.");
}
}
if (command.equals(Command.CONFIGURATION) || command.equals(Command.ALL)) {
ConfigurationCommand configurationCommand = new ConfigurationCommand(mMetaClient, System.out);
configurationCommand.run();
}
if (command.equals(Command.STORAGE) || command.equals(Command.ALL)) {
StorageCommand storageCommand = new StorageCommand(mBlockClient, System.out);
storageCommand.run();
}
return 0;
}
Aggregations