use of alluxio.job.JobConfig 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());
}
use of alluxio.job.JobConfig 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());
}
use of alluxio.job.JobConfig 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());
}
use of alluxio.job.JobConfig in project alluxio by Alluxio.
the class JobMasterTest method list.
@Test
public void list() throws Exception {
PlanCoordinator coordinator = PowerMockito.mock(PlanCoordinator.class);
mockStatic(PlanCoordinator.class);
when(PlanCoordinator.create(any(CommandManager.class), any(JobServerContext.class), anyList(), anyLong(), any(JobConfig.class), any(Consumer.class))).thenReturn(coordinator);
TestPlanConfig jobConfig = new TestPlanConfig("/test");
List<Long> jobIdList = new ArrayList<>();
for (long i = 0; i < TEST_JOB_MASTER_JOB_CAPACITY; i++) {
jobIdList.add(mJobMaster.run(jobConfig));
}
final List<Long> list = mJobMaster.list(ListAllPOptions.getDefaultInstance());
Assert.assertEquals(jobIdList, list);
Assert.assertEquals(TEST_JOB_MASTER_JOB_CAPACITY, mJobMaster.list(ListAllPOptions.getDefaultInstance()).size());
}
use of alluxio.job.JobConfig in project alluxio by Alluxio.
the class WorkflowTrackerTest method testEmpty.
@Test
public void testEmpty() throws Exception {
ArrayList<JobConfig> jobs = Lists.newArrayList();
CompositeConfig config = new CompositeConfig(jobs, true);
mWorkflowTracker.run(config, 0);
WorkflowInfo info = mWorkflowTracker.getStatus(0, true);
assertEquals(Status.COMPLETED, info.getStatus());
}
Aggregations