Search in sources :

Example 1 with CompactConfig

use of alluxio.job.plan.transform.CompactConfig in project alluxio by Alluxio.

the class CompactActionTest method dynamicNumFiles.

@Test
public void dynamicNumFiles() {
    final CompactAction compactAction = parse("file.count.max=1000;file.size.min=1024");
    HiveLayout from = TableTestUtils.createLayout("/from");
    HiveLayout to = TableTestUtils.createLayout("/to");
    JobConfig job = compactAction.generateJobConfig(from, to, false);
    assertEquals(CompactConfig.class, job.getClass());
    CompactConfig compact = (CompactConfig) job;
    assertEquals("/from", compact.getInput());
    assertEquals("/to", compact.getOutput());
    assertEquals(1000, compact.getMaxNumFiles());
    assertEquals(1024, compact.getMinFileSize());
}
Also used : HiveLayout(alluxio.table.common.layout.HiveLayout) CompactConfig(alluxio.job.plan.transform.CompactConfig) JobConfig(alluxio.job.JobConfig) Test(org.junit.Test)

Example 2 with CompactConfig

use of alluxio.job.plan.transform.CompactConfig in project alluxio by Alluxio.

the class CompactActionTest method generateJobConfig.

@Test
public void generateJobConfig() {
    final CompactAction compactAction = parse("file.count.max=12");
    HiveLayout from = TableTestUtils.createLayout("/from");
    HiveLayout to = TableTestUtils.createLayout("/to");
    JobConfig job = compactAction.generateJobConfig(from, to, false);
    assertEquals(CompactConfig.class, job.getClass());
    CompactConfig compact = (CompactConfig) job;
    assertEquals("/from", compact.getInput());
    assertEquals("/to", compact.getOutput());
    assertEquals(12, compact.getMaxNumFiles());
}
Also used : HiveLayout(alluxio.table.common.layout.HiveLayout) CompactConfig(alluxio.job.plan.transform.CompactConfig) JobConfig(alluxio.job.JobConfig) Test(org.junit.Test)

Example 3 with CompactConfig

use of alluxio.job.plan.transform.CompactConfig in project alluxio by Alluxio.

the class TransformPlanTest method getJobConfigs.

@Test
public void getJobConfigs() {
    HiveLayout from = TableTestUtils.createLayout("/from");
    HiveLayout to = TableTestUtils.createLayout("/to");
    TransformDefinition definition = TransformDefinition.parse("file.count.max=12");
    TransformPlan plan = new TransformPlan(from, to, definition);
    assertEquals(from, plan.getBaseLayout());
    assertEquals(to, plan.getTransformedLayout());
    ArrayList<JobConfig> jobs = plan.getJobConfigs();
    assertEquals(1, jobs.size());
    assertEquals(CompactConfig.class, jobs.get(0).getClass());
    CompactConfig compact = (CompactConfig) jobs.get(0);
    assertEquals("/from", compact.getInput());
    assertEquals("/to", compact.getOutput());
    assertEquals(12, compact.getMaxNumFiles());
}
Also used : HiveLayout(alluxio.table.common.layout.HiveLayout) CompactConfig(alluxio.job.plan.transform.CompactConfig) JobConfig(alluxio.job.JobConfig) Test(org.junit.Test)

Aggregations

JobConfig (alluxio.job.JobConfig)3 CompactConfig (alluxio.job.plan.transform.CompactConfig)3 HiveLayout (alluxio.table.common.layout.HiveLayout)3 Test (org.junit.Test)3