Search in sources :

Example 1 with PlanTracker

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());
}
Also used : PlanTracker(alluxio.master.job.plan.PlanTracker) BlockInfo(alluxio.wire.BlockInfo) WorkflowTracker(alluxio.master.job.workflow.WorkflowTracker) JobIntegrationTest(alluxio.job.JobIntegrationTest) Test(org.junit.Test)

Example 2 with PlanTracker

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);
}
Also used : JobMaster(alluxio.master.job.JobMaster) JobServerContext(alluxio.job.JobServerContext) PlanTracker(alluxio.master.job.plan.PlanTracker) CommandManager(alluxio.master.job.command.CommandManager) WorkerInfo(alluxio.wire.WorkerInfo) Before(org.junit.Before)

Example 3 with PlanTracker

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());
}
Also used : PlanTracker(alluxio.master.job.plan.PlanTracker) BlockInfo(alluxio.wire.BlockInfo) WorkflowTracker(alluxio.master.job.workflow.WorkflowTracker) JobIntegrationTest(alluxio.job.JobIntegrationTest) Test(org.junit.Test)

Aggregations

PlanTracker (alluxio.master.job.plan.PlanTracker)3 JobIntegrationTest (alluxio.job.JobIntegrationTest)2 WorkflowTracker (alluxio.master.job.workflow.WorkflowTracker)2 BlockInfo (alluxio.wire.BlockInfo)2 Test (org.junit.Test)2 JobServerContext (alluxio.job.JobServerContext)1 JobMaster (alluxio.master.job.JobMaster)1 CommandManager (alluxio.master.job.command.CommandManager)1 WorkerInfo (alluxio.wire.WorkerInfo)1 Before (org.junit.Before)1