protected CommandExecutor.Result execute(TestCmd cmd) throws Exception { throw new Exception("Unknow type of Test command:"+ cmd.getType()); }
} else if (qName.equals("command")) { if (testCommands != null) { testCommands.add(new TestCmd(charString, CommandType.FS)); } else if (cleanupCommands != null) { cleanupCommands.add(new TestCmd(charString, CommandType.FS)); testCommands.add(new TestCmd(charString, CommandType.DFSADMIN)); } else if (cleanupCommands != null) { cleanupCommands.add(new TestCmd(charString, CommandType.DFSADMIN)); testCommands.add(new TestCmd(charString, CommandType.MRADMIN)); } else if (cleanupCommands != null) { cleanupCommands.add(new TestCmd(charString, CommandType.MRADMIN)); testCommands.add(new TestCmd(charString, CommandType.ARCHIVE)); } else if (cleanupCommands != null) { cleanupCommands.add(new TestCmd(charString, CommandType.ARCHIVE));
CommandExecutor executor = CmdFactoryDFS.getCommandExecutor( new CLITestData.TestCmd(cmd, CLITestData.TestCmd.CommandType.DFSADMIN), namenode); executor.executeCommand(cmd);
public static CommandExecutor getCommandExecutor(CLITestData.TestCmd cmd, String tag) throws IllegalArgumentException { CommandExecutor executor = null; switch (cmd.getType()) { case FS: executor = new CLICommands.FSCmdExecutor(tag, new FsShell()); break; default: throw new IllegalArgumentException("Unknown type of Test command:" + cmd.getType()); } return executor; } }
@Override protected Result execute(TestCmd cmd) throws Exception { return CmdFactoryDFS.getCommandExecutor(cmd, namenode).executeCommand(cmd.getCmd()); }
public static CommandExecutor getCommandExecutor(CLITestData.TestCmd cmd, String tag) throws IllegalArgumentException { CommandExecutor executor; switch (cmd.getType()) { case DFSADMIN: executor = new CLICommands.FSCmdExecutor(tag, new DFSAdmin()); break; default: executor = CmdFactory.getCommandExecutor(cmd, tag); } return executor; } }
@Override protected CommandExecutor.Result execute(CLITestData.TestCmd cmd) throws Exception { return CmdFactory.getCommandExecutor(cmd, "").executeCommand(cmd.getCmd()); }
protected Result execute(TestCmd cmd) throws Exception { if(cmd.getType() == TestCmd.CommandType.MRADMIN) { return cmdExecutor.executeCommand(cmd.getCmd()); } else if(cmd.getType() == TestCmd.CommandType.ARCHIVE) { return archiveCmdExecutor.executeCommand(cmd.getCmd()); } else { return super.execute(cmd); } }