Search in sources :

Example 6 with ActionScheduler

use of org.smartdata.model.action.ActionScheduler 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));
}
Also used : CmdletManager(org.smartdata.server.engine.CmdletManager) ActionScheduler(org.smartdata.model.action.ActionScheduler) CompressionScheduler(org.smartdata.hdfs.scheduler.CompressionScheduler) Test(org.junit.Test)

Aggregations

ActionScheduler (org.smartdata.model.action.ActionScheduler)6 Test (org.junit.Test)3 ActionInfo (org.smartdata.model.ActionInfo)3 CmdletManager (org.smartdata.server.engine.CmdletManager)3 CompressionScheduler (org.smartdata.hdfs.scheduler.CompressionScheduler)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 FSDataOutputStream (org.apache.hadoop.fs.FSDataOutputStream)1 Path (org.apache.hadoop.fs.Path)1 CachePoolEntry (org.apache.hadoop.hdfs.protocol.CachePoolEntry)1 HdfsFileStatus (org.apache.hadoop.hdfs.protocol.HdfsFileStatus)1 CacheScheduler (org.smartdata.hdfs.scheduler.CacheScheduler)1 CmdletInfo (org.smartdata.model.CmdletInfo)1 CompressionFileState (org.smartdata.model.CompressionFileState)1 FileState (org.smartdata.model.FileState)1 LaunchAction (org.smartdata.model.LaunchAction)1 ScheduleResult (org.smartdata.model.action.ScheduleResult)1