use of alluxio.master.job.plan.PlanTracker in project alluxio by Alluxio.
the class ReplicateIntegrationTest method replicateLastBlockFromUFS.
@Test
@LocalAlluxioClusterResource.Config(confParams = { PropertyKey.Name.JOB_MASTER_JOB_CAPACITY, "1", PropertyKey.Name.JOB_MASTER_FINISHED_JOB_RETENTION_TIME, "0" })
public void replicateLastBlockFromUFS() throws Exception {
// run the replicate job for mBlockId2
// hack - use a plan tracker with capacity of 1
PlanTracker planTracker = new PlanTracker(1, 0, -1, mock(WorkflowTracker.class));
Whitebox.setInternalState(mJobMaster, "mPlanTracker", planTracker);
waitForJobToFinish(mJobMaster.run(new ReplicateConfig(TEST_URI, mBlockId2, 1)));
BlockInfo blockInfo1 = AdjustJobTestUtils.getBlock(mBlockId1, mFsContext);
BlockInfo blockInfo2 = AdjustJobTestUtils.getBlock(mBlockId2, mFsContext);
Assert.assertEquals(0, blockInfo1.getLocations().size());
Assert.assertEquals(1, blockInfo2.getLocations().size());
Assert.assertEquals(TEST_BLOCK_SIZE, blockInfo1.getLength());
Assert.assertEquals(1, blockInfo2.getLength());
}
use of alluxio.master.job.plan.PlanTracker in project alluxio by Alluxio.
the class WorkflowTrackerTest method before.
@Before
public void before() throws Exception {
mMockJobMaster = mock(JobMaster.class);
mWorkflowTracker = new WorkflowTracker(mMockJobMaster);
mPlanTracker = new PlanTracker(CAPACITY, RETENTION_TIME, PURGE_CONUT, mWorkflowTracker);
mJobIdCounter = 100;
when(mMockJobMaster.getNewJobId()).thenAnswer(invocation -> mJobIdCounter++);
mWorkers = Lists.newArrayList(new WorkerInfo());
mCommandManager = new CommandManager();
mMockJobServerContext = mock(JobServerContext.class);
}
use of alluxio.master.job.plan.PlanTracker in project alluxio by Alluxio.
the class ReplicateIntegrationTest method replicateFullBlockFromUFS.
@Test
@LocalAlluxioClusterResource.Config(confParams = { PropertyKey.Name.JOB_MASTER_JOB_CAPACITY, "1", PropertyKey.Name.JOB_MASTER_FINISHED_JOB_RETENTION_TIME, "0" })
public void replicateFullBlockFromUFS() throws Exception {
// run the replicate job for mBlockId1
// hack - use a job tracker with capacity of 1
PlanTracker planTracker = new PlanTracker(1, 0, -1, mock(WorkflowTracker.class));
Whitebox.setInternalState(mJobMaster, "mPlanTracker", planTracker);
waitForJobToFinish(mJobMaster.run(new ReplicateConfig(TEST_URI, mBlockId1, 1)));
BlockInfo blockInfo1 = AdjustJobTestUtils.getBlock(mBlockId1, mFsContext);
BlockInfo blockInfo2 = AdjustJobTestUtils.getBlock(mBlockId2, mFsContext);
Assert.assertEquals(1, blockInfo1.getLocations().size());
Assert.assertEquals(0, blockInfo2.getLocations().size());
Assert.assertEquals(TEST_BLOCK_SIZE, blockInfo1.getLength());
Assert.assertEquals(1, blockInfo2.getLength());
}
Aggregations