use of org.smartdata.SmartContext in project SSM by Intel-bigdata.
the class ActionMiniCluster method init.
@Before
public void init() throws Exception {
SmartConf conf = new SmartConf();
initConf(conf);
cluster = new MiniDFSCluster.Builder(conf).numDataNodes(5).storagesPerDatanode(3).storageTypes(new StorageType[] { StorageType.DISK, StorageType.ARCHIVE, StorageType.SSD }).build();
cluster.waitActive();
dfs = cluster.getFileSystem();
dfsClient = dfs.getClient();
smartContext = new SmartContext(conf);
}
use of org.smartdata.SmartContext 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.SmartContext 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