use of org.smartdata.actions.hdfs.HdfsAction in project SSM by Intel-bigdata.
the class CommandExecutor method createAction.
private SmartAction createAction(String name) throws IOException {
SmartAction smartAction = actionRegistry.createAction(name);
smartAction.setContext(smartContext);
if (smartAction instanceof HdfsAction) {
((HdfsAction) smartAction).setDfsClient(new SmartDFSClient(ssm.getNamenodeURI(), smartContext.getConf(), getRpcServerAddress()));
}
smartAction.getActionStatus().setId(currentActionId);
currentActionId++;
return smartAction;
}
use of org.smartdata.actions.hdfs.HdfsAction in project SSM by Intel-bigdata.
the class TestCommand method runHelper.
private Command runHelper() throws IOException {
HdfsAction[] actions = new HdfsAction[4];
// New action
// actions[0] = new AllSsdFileAction();
// actions[0].setDfsClient(client);
// actions[0].setContext(new SmartContext(smartConf));
// actions[0].init(new String[]{"/testMoveFile/file1"});
// actions[1] = new MoveFileAction();
// actions[1].setDfsClient(client);
// actions[1].setContext(new SmartContext(smartConf));
// actions[1].init(new String[]{"/testMoveFile/file2", "COLD"});
actions[2] = new CacheFileAction();
actions[2].setDfsClient(client);
actions[2].setContext(new SmartContext(smartConf));
actions[2].init(new String[] { "/testCacheFile" });
// New Command
Command cmd = new Command(actions, null);
cmd.setId(1);
cmd.setRuleId(1);
cmd.setState(CommandState.PENDING);
return cmd;
}
use of org.smartdata.actions.hdfs.HdfsAction in project SSM by Intel-bigdata.
the class TestCommandPool method runHelper.
private Command runHelper() throws IOException {
HdfsAction[] actions = new HdfsAction[4];
// New action
// actions[0] = new MoveFileAction();
// actions[0].setDfsClient(client);
// actions[0].setContext(new SmartContext(smartConf));
// actions[0].init(new String[]{"/testMoveFile/file1", "ALL_SSD"});
// actions[0].getActionStatus().setId(UUID.randomUUID());
// actions[1] = new MoveFileAction();
// actions[1].setDfsClient(client);
// actions[1].setContext(new SmartContext(smartConf));
// actions[1].init(new String[]{"/testMoveFile/file2", "COLD"});
// actions[1].getActionStatus().setId(UUID.randomUUID());
actions[2] = new CacheFileAction();
actions[2].setDfsClient(client);
actions[2].setContext(new SmartContext(smartConf));
actions[2].init(new String[] { "/testCacheFile" });
// New Command
Command cmd = new Command(actions, null);
cmd.setId(1);
cmd.setRuleId(1);
cmd.setState(CommandState.PENDING);
return cmd;
}
Aggregations