Search in sources :

Example 1 with CacheFileAction

use of org.smartdata.actions.hdfs.CacheFileAction 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;
}
Also used : CacheFileAction(org.smartdata.actions.hdfs.CacheFileAction) HdfsAction(org.smartdata.actions.hdfs.HdfsAction) SmartContext(org.smartdata.SmartContext)

Example 2 with CacheFileAction

use of org.smartdata.actions.hdfs.CacheFileAction 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;
}
Also used : CacheFileAction(org.smartdata.actions.hdfs.CacheFileAction) HdfsAction(org.smartdata.actions.hdfs.HdfsAction) SmartContext(org.smartdata.SmartContext)

Aggregations

SmartContext (org.smartdata.SmartContext)2 CacheFileAction (org.smartdata.actions.hdfs.CacheFileAction)2 HdfsAction (org.smartdata.actions.hdfs.HdfsAction)2