@Test public void flowControl() 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"); for (long i = 0; i < TEST_JOB_MASTER_JOB_CAPACITY; i++) { mJobMaster.run(jobConfig); } try { mJobMaster.run(jobConfig); Assert.fail("should not be able to run more jobs than job master capacity"); } catch (ResourceExhaustedException e) { Assert.assertEquals(ExceptionMessage.JOB_MASTER_FULL_CAPACITY .getMessage(ServerConfiguration.get(PropertyKey.JOB_MASTER_JOB_CAPACITY)), e.getMessage()); } }
public synchronized long run(JobConfig jobConfig) throws JobDoesNotExistException, ResourceExhaustedException { long jobId = getNewJobId(); run(jobConfig, jobId); return jobId; }
JobMaster extends AbstractMaster implements NoopJournaled { public synchronized long run(JobConfig jobConfig) throws JobDoesNotExistException, ResourceExhaustedException { long jobId = getNewJobId(); run(jobConfig, jobId); return jobId; } }
JobMaster extends AbstractMaster implements NoopJournaled { public synchronized long run(JobConfig jobConfig) throws JobDoesNotExistException, ResourceExhaustedException { long jobId = getNewJobId(); run(jobConfig, jobId); return jobId; } JobMaster(MasterContext masterContext, FileSystem filesystem,
      FileSystemContext fsContext, UfsManager ufsManager); }
JobMaster extends AbstractMaster implements NoopJournaled { public synchronized long run(JobConfig jobConfig) throws JobDoesNotExistException, ResourceExhaustedException { long jobId = getNewJobId(); run(jobConfig, jobId); return jobId; } JobMaster(MasterContext masterContext, FileSystem filesystem,
      FileSystemContext fsContext, UfsManager ufsManager); long getNewJobId(); @Override void start(Boolean isLeader); @Override Map<ServiceType, GrpcService> getServices(); @Override String getName(); synchronized long run(JobConfig jobConfig); synchronized void run(JobConfig jobConfig, long jobId); void cancel(long jobId); List<Long> list(); List<JobInfo> listDetailed(); List<JobInfo> failed(int limit, long before, long after); JobInfo getStatus(long jobId); JobInfo getStatus(long jobId, boolean verbose); alluxio.job.wire.JobServiceSummary getSummary(); List<JobWorkerHealth> getAllWorkerHealth(); long registerWorker(WorkerNetAddress workerNetAddress); List<WorkerInfo> getWorkerInfoList(); void setTaskPoolSize(int taskPoolSize); List<JobCommand> workerHeartbeat(JobWorkerHealth jobWorkerHealth,
      List<TaskInfo> taskInfoList); }
JobMaster extends AbstractMaster implements NoopJournaled { public synchronized long run(JobConfig jobConfig) throws JobDoesNotExistException, ResourceExhaustedException { long jobId = getNewJobId(); run(jobConfig, jobId); return jobId; } JobMaster(MasterContext masterContext, FileSystem filesystem,
      FileSystemContext fsContext, UfsManager ufsManager); long getNewJobId(); @Override void start(Boolean isLeader); @Override Map<ServiceType, GrpcService> getServices(); @Override String getName(); synchronized long run(JobConfig jobConfig); synchronized void run(JobConfig jobConfig, long jobId); void cancel(long jobId); List<Long> list(); List<JobInfo> listDetailed(); List<JobInfo> failed(int limit, long before, long after); JobInfo getStatus(long jobId); JobInfo getStatus(long jobId, boolean verbose); alluxio.job.wire.JobServiceSummary getSummary(); List<JobWorkerHealth> getAllWorkerHealth(); long registerWorker(WorkerNetAddress workerNetAddress); List<WorkerInfo> getWorkerInfoList(); void setTaskPoolSize(int taskPoolSize); List<JobCommand> workerHeartbeat(JobWorkerHealth jobWorkerHealth,
      List<TaskInfo> taskInfoList);  }