}
@Override
public CommandStatus getCommandStatus(long cmdid) throws IOException {
try {
CommandStatusThrift cst = masterClient.getCmdStatus(cmdid);
if (cst == null) {
throw new IOException("Illegal command id: " + cmdid);
}
FlumeMasterCommandThrift cmdt = cst.getCmd();
Command cmd = new Command(cmdt.getCommand(), cmdt.arguments
.toArray(new String[0]));
CommandStatus cs = new CommandStatus(cst.getCmdId(), cmd,
CommandStatus.State.valueOf(cst.state), cst.getMessage());
return cs;
} catch (TException e) {
throw new IOException(e);
}
}