use of org.smartdata.server.engine.CmdletManager in project SSM by Intel-bigdata.
the class TestCompressDecompress method testCheckCompressAction.
@Test
public void testCheckCompressAction() throws Exception {
int arraySize = 1024 * 1024 * 8;
String fileDir = "/ssm/compression/";
String fileName = "file5";
String filePath = fileDir + fileName;
prepareFile(filePath, arraySize);
CmdletManager cmdletManager = ssm.getCmdletManager();
long cmdId = cmdletManager.submitCmdlet("checkcompress -file " + filePath);
waitTillActionDone(cmdId);
// Test directory case.
cmdId = cmdletManager.submitCmdlet("checkcompress -file " + fileDir);
waitTillActionDone(cmdId);
}
use of org.smartdata.server.engine.CmdletManager in project SSM by Intel-bigdata.
the class TestCompressDecompress method testCompressDecompressDir.
@Test
public void testCompressDecompressDir() throws Exception {
String dir = "/ssm/compression";
dfsClient.mkdirs(dir, null, true);
CmdletManager cmdletManager = ssm.getCmdletManager();
List<ActionScheduler> schedulers = cmdletManager.getSchedulers("decompress");
Assert.assertTrue(schedulers.size() == 1);
ActionScheduler scheduler = schedulers.get(0);
Assert.assertTrue(scheduler instanceof CompressionScheduler);
// Expect that a dir cannot be compressed.
Assert.assertFalse(((CompressionScheduler) scheduler).supportCompression(dir));
// Expect that a dir cannot be decompressed.
Assert.assertFalse(((CompressionScheduler) scheduler).supportDecompression(dir));
}
use of org.smartdata.server.engine.CmdletManager in project SSM by Intel-bigdata.
the class TestSmallFileScheduler method testScheduler.
@Test(timeout = 180000)
public void testScheduler() throws Exception {
waitTillSSMExitSafeMode();
Thread.sleep(2000);
CmdletManager cmdletManager = ssm.getCmdletManager();
long cmdId = cmdletManager.submitCmdlet("compact -file " + "['/test/small_files/file_0','/test/small_files/file_1'] " + "-containerFile /test/small_files/container_file_2");
while (true) {
Thread.sleep(3000);
CmdletState state = cmdletManager.getCmdletInfo(cmdId).getState();
if (state == CmdletState.DONE) {
long containerFileLen = dfsClient.getFileInfo("/test/small_files/container_file_2").getLen();
Assert.assertEquals(sumFileLen, containerFileLen);
Assert.assertEquals(0, dfsClient.getFileInfo("/test/small_files/file_1").getLen());
return;
} else if (state == CmdletState.FAILED) {
Assert.fail("Compact failed.");
} else {
System.out.println(state);
}
}
}
Aggregations