Search in sources :

Example 1 with CommandManager

use of alluxio.master.job.command.CommandManager in project alluxio by Alluxio.

the class PlanCoordinatorTest method before.

@Before
public void before() throws Exception {
    mCommandManager = new CommandManager();
    // Create mock JobServerContext
    FileSystem fs = mock(FileSystem.class);
    FileSystemContext fsCtx = PowerMockito.mock(FileSystemContext.class);
    UfsManager ufsManager = Mockito.mock(UfsManager.class);
    mJobServerContext = new JobServerContext(fs, fsCtx, ufsManager);
    // Create mock job info.
    mJobconfig = Mockito.mock(JobConfig.class, Mockito.withSettings().serializable());
    Mockito.when(mJobconfig.getName()).thenReturn("mock");
    mJobId = 1;
    // Create mock job definition.
    @SuppressWarnings("unchecked") PlanDefinition<JobConfig, Serializable, Serializable> mockPlanDefinition = Mockito.mock(PlanDefinition.class);
    PlanDefinitionRegistry singleton = PowerMockito.mock(PlanDefinitionRegistry.class);
    Whitebox.setInternalState(PlanDefinitionRegistry.class, "INSTANCE", singleton);
    Mockito.when(singleton.getJobDefinition(mJobconfig)).thenReturn(mockPlanDefinition);
    mPlanDefinition = mockPlanDefinition;
    // Create test worker.
    mWorkerInfo = new WorkerInfo();
    mWorkerInfo.setId(0);
    mWorkerInfoList = Lists.newArrayList(mWorkerInfo);
}
Also used : PlanDefinitionRegistry(alluxio.job.plan.PlanDefinitionRegistry) JobServerContext(alluxio.job.JobServerContext) Serializable(java.io.Serializable) CommandManager(alluxio.master.job.command.CommandManager) UfsManager(alluxio.underfs.UfsManager) FileSystem(alluxio.client.file.FileSystem) FileSystemContext(alluxio.client.file.FileSystemContext) WorkerInfo(alluxio.wire.WorkerInfo) JobConfig(alluxio.job.JobConfig) Before(org.junit.Before)

Example 2 with CommandManager

use of alluxio.master.job.command.CommandManager in project alluxio by Alluxio.

the class PlanTrackerTest method before.

@Before
public void before() {
    mMockWorkflowTracker = mock(WorkflowTracker.class);
    mTracker = new PlanTracker(CAPACITY, RETENTION_TIME, PURGE_CONUT, mMockWorkflowTracker);
    mCommandManager = new CommandManager();
    mMockJobServerContext = mock(JobServerContext.class);
    mWorkers = Lists.newArrayList(new WorkerInfo());
    mJobIdGenerator = new JobIdGenerator();
}
Also used : JobServerContext(alluxio.job.JobServerContext) CommandManager(alluxio.master.job.command.CommandManager) WorkflowTracker(alluxio.master.job.workflow.WorkflowTracker) WorkerInfo(alluxio.wire.WorkerInfo) JobIdGenerator(alluxio.job.meta.JobIdGenerator) Before(org.junit.Before)

Example 3 with CommandManager

use of alluxio.master.job.command.CommandManager 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)

Aggregations

JobServerContext (alluxio.job.JobServerContext)3 CommandManager (alluxio.master.job.command.CommandManager)3 WorkerInfo (alluxio.wire.WorkerInfo)3 Before (org.junit.Before)3 FileSystem (alluxio.client.file.FileSystem)1 FileSystemContext (alluxio.client.file.FileSystemContext)1 JobConfig (alluxio.job.JobConfig)1 JobIdGenerator (alluxio.job.meta.JobIdGenerator)1 PlanDefinitionRegistry (alluxio.job.plan.PlanDefinitionRegistry)1 JobMaster (alluxio.master.job.JobMaster)1 PlanTracker (alluxio.master.job.plan.PlanTracker)1 WorkflowTracker (alluxio.master.job.workflow.WorkflowTracker)1 UfsManager (alluxio.underfs.UfsManager)1 Serializable (java.io.Serializable)1