Search in sources :

Example 1 with DisableJobClusterRequest

use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest in project mantis by Netflix.

the class JobClusterTest method testJobClusterDisable.

@Test
public void testJobClusterDisable() throws InterruptedException {
    TestKit probe = new TestKit(system);
    CountDownLatch storeCompletedCalled = new CountDownLatch(1);
    String clusterName = "testJobClusterDisable";
    MantisScheduler schedulerMock = mock(MantisScheduler.class);
    MantisJobStore jobStoreMock = mock(MantisJobStore.class);
    final JobClusterDefinitionImpl fakeJobCluster = createFakeJobClusterDefn(clusterName);
    ActorRef jobClusterActor = system.actorOf(props(clusterName, jobStoreMock, schedulerMock, eventPublisher));
    jobClusterActor.tell(new JobClusterProto.InitializeJobClusterRequest(fakeJobCluster, user, probe.getRef()), probe.getRef());
    JobClusterProto.InitializeJobClusterResponse createResp = probe.expectMsgClass(JobClusterProto.InitializeJobClusterResponse.class);
    assertEquals(SUCCESS, createResp.responseCode);
    try {
        final JobDefinition jobDefn = createJob(clusterName, 1, MantisJobDurationType.Transient);
        String jobId = clusterName + "-1";
        IMantisJobMetadata completedJobMock = new MantisJobMetadataImpl.Builder().withJobId(new JobId(clusterName, 1)).withJobDefinition(jobDefn).withJobState(JobState.Completed).build();
        when(jobStoreMock.getArchivedJob(any())).thenReturn(of(completedJobMock));
        doAnswer((Answer) invocation -> {
            storeCompletedCalled.countDown();
            return null;
        }).when(jobStoreMock).storeCompletedJobForCluster(any(), any());
        JobTestHelper.submitJobAndVerifySuccess(probe, clusterName, jobClusterActor, jobDefn, jobId);
        JobTestHelper.getJobDetailsAndVerify(probe, jobClusterActor, jobId, SUCCESS, JobState.Accepted);
        jobClusterActor.tell(new DisableJobClusterRequest(clusterName, "user"), probe.getRef());
        DisableJobClusterResponse disableResp = probe.expectMsgClass(DisableJobClusterResponse.class);
        assertEquals(SUCCESS, disableResp.responseCode);
        jobClusterActor.tell(new GetJobClusterRequest(clusterName), probe.getRef());
        GetJobClusterResponse getJobClusterResp = probe.expectMsgClass(GetJobClusterResponse.class);
        assertTrue(getJobClusterResp.getJobCluster().get().isDisabled());
        jobClusterActor.tell(new GetJobDetailsRequest(clusterName, JobId.fromId(jobId).get()), probe.getRef());
        GetJobDetailsResponse jobDetailsResp = probe.expectMsgClass(GetJobDetailsResponse.class);
        assertEquals(SUCCESS, jobDetailsResp.responseCode);
        assertEquals(jobId, jobDetailsResp.getJobMetadata().get().getJobId().getId());
        assertEquals(JobState.Completed, jobDetailsResp.getJobMetadata().get().getState());
        verify(jobStoreMock, times(1)).createJobCluster(any());
        verify(jobStoreMock, times(2)).updateJobCluster(any());
        verify(jobStoreMock, times(1)).storeNewJob(any());
        verify(jobStoreMock, times(1)).updateStage(any());
        verify(jobStoreMock, times(2)).updateJob(any());
        verify(jobStoreMock, times(1)).storeNewWorkers(any(), any());
        storeCompletedCalled.await(1, TimeUnit.SECONDS);
    } catch (Exception e) {
        e.printStackTrace();
        fail();
    }
}
Also used : TestHelpers(com.netflix.mantis.master.scheduler.TestHelpers) MantisJobDurationType(io.mantisrx.runtime.MantisJobDurationType) MantisJobState(io.mantisrx.runtime.MantisJobState) Optional.of(java.util.Optional.of) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) GetLastSubmittedJobIdStreamResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetLastSubmittedJobIdStreamResponse) Mockito.doThrow(org.mockito.Mockito.doThrow) ListArchivedWorkersRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListArchivedWorkersRequest) UpdateJobClusterLabelsResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterLabelsResponse) ActorRef(akka.actor.ActorRef) InvalidJobException(io.mantisrx.runtime.command.InvalidJobException) UpdateJobClusterArtifactResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterArtifactResponse) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Duration(java.time.Duration) Map(java.util.Map) JobClusterProtoAdapter(io.mantisrx.master.api.akka.route.proto.JobClusterProtoAdapter) Schedulers(rx.schedulers.Schedulers) MigrationStrategyEnum(io.mantisrx.runtime.WorkerMigrationConfig.MigrationStrategyEnum) AfterClass(org.junit.AfterClass) DisableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterResponse) ScaleStageRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ScaleStageRequest) BaseResponse(io.mantisrx.master.jobcluster.proto.BaseResponse) Matchers.any(org.mockito.Matchers.any) CountDownLatch(java.util.concurrent.CountDownLatch) SubmitJobRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.SubmitJobRequest) WorkerState(io.mantisrx.master.jobcluster.job.worker.WorkerState) UpdateJobClusterWorkerMigrationStrategyRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterWorkerMigrationStrategyRequest) ListJobIdsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobIdsRequest) Assert.assertFalse(org.junit.Assert.assertFalse) NamedJob(io.mantisrx.server.master.store.NamedJob) BehaviorSubject(rx.subjects.BehaviorSubject) Mockito.mock(org.mockito.Mockito.mock) Optional.empty(java.util.Optional.empty) IMantisStorageProvider(io.mantisrx.server.master.persistence.IMantisStorageProvider) SERVER_ERROR(io.mantisrx.master.jobcluster.proto.BaseResponse.ResponseCode.SERVER_ERROR) Matchers.anyString(org.mockito.Matchers.anyString) ArrayList(java.util.ArrayList) ListJobIdsResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobIdsResponse) Mockito.timeout(org.mockito.Mockito.timeout) Answer(org.mockito.stubbing.Answer) LifecycleEventPublisherImpl(io.mantisrx.master.events.LifecycleEventPublisherImpl) JobTestHelper(io.mantisrx.master.jobcluster.job.JobTestHelper) WorkerEvent(io.mantisrx.server.master.scheduler.WorkerEvent) GetLastSubmittedJobIdStreamRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetLastSubmittedJobIdStreamRequest) Label(io.mantisrx.common.Label) Config(com.typesafe.config.Config) EnableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterRequest) Assert.assertTrue(org.junit.Assert.assertTrue) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) GetJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterRequest) TYPE(io.mantisrx.server.core.Status.TYPE) File(java.io.File) UpdateJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterRequest) UpdateJobClusterWorkerMigrationStrategyResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterWorkerMigrationStrategyResponse) IMantisJobMetadata(io.mantisrx.master.jobcluster.job.IMantisJobMetadata) MantisStorageProviderAdapter(io.mantisrx.server.master.persistence.MantisStorageProviderAdapter) Assert.assertEquals(org.junit.Assert.assertEquals) ListJobsResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobsResponse) IMantisWorkerMetadata(io.mantisrx.master.jobcluster.job.worker.IMantisWorkerMetadata) EnableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterResponse) JobState(io.mantisrx.master.jobcluster.job.JobState) JobCompletedReason(io.mantisrx.server.core.JobCompletedReason) StageDeploymentStrategy(io.mantisrx.runtime.descriptor.StageDeploymentStrategy) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) ListJobsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobsRequest) CLIENT_ERROR(io.mantisrx.master.jobcluster.proto.BaseResponse.ResponseCode.CLIENT_ERROR) JobOwner(io.mantisrx.runtime.JobOwner) GetJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterResponse) JobClusterProto(io.mantisrx.master.jobcluster.proto.JobClusterProto) JobWorker(io.mantisrx.master.jobcluster.job.worker.JobWorker) GetJobDetailsResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobDetailsResponse) Assert.fail(org.junit.Assert.fail) ResubmitWorkerResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ResubmitWorkerResponse) StatusEventSubscriberLoggingImpl(io.mantisrx.master.events.StatusEventSubscriberLoggingImpl) Status(io.mantisrx.server.core.Status) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) ResubmitWorkerRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ResubmitWorkerRequest) WorkerEventSubscriberLoggingImpl(io.mantisrx.master.events.WorkerEventSubscriberLoggingImpl) UpdateJobClusterLabelsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterLabelsRequest) WorkerId(io.mantisrx.server.core.domain.WorkerId) List(java.util.List) ActorSystem(akka.actor.ActorSystem) GetJobDetailsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobDetailsRequest) SubmitJobResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.SubmitJobResponse) StageScalingPolicy(io.mantisrx.runtime.descriptor.StageScalingPolicy) Optional(java.util.Optional) UpdateJobClusterSLARequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterSLARequest) ScaleStageResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ScaleStageResponse) MantisJobMetadataView(io.mantisrx.master.jobcluster.job.MantisJobMetadataView) UpdateJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterResponse) BeforeClass(org.junit.BeforeClass) WorkerTerminate(io.mantisrx.master.jobcluster.job.worker.WorkerTerminate) WorkerMigrationConfig(io.mantisrx.runtime.WorkerMigrationConfig) ListArchivedWorkersResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListArchivedWorkersResponse) MantisJobMetadataImpl(io.mantisrx.master.jobcluster.job.MantisJobMetadataImpl) JobSla(io.mantisrx.runtime.JobSla) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) io.mantisrx.server.master.domain(io.mantisrx.server.master.domain) HashMap(java.util.HashMap) UpdateJobClusterSLAResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterSLAResponse) AuditEventSubscriberLoggingImpl(io.mantisrx.master.events.AuditEventSubscriberLoggingImpl) JobInfo(io.mantisrx.master.jobcluster.JobClusterActor.JobInfo) SchedulingInfo(io.mantisrx.runtime.descriptor.SchedulingInfo) ConfigFactory(com.typesafe.config.ConfigFactory) MachineDefinition(io.mantisrx.runtime.MachineDefinition) ListJobCriteria(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobCriteria) Mockito.when(org.mockito.Mockito.when) TestKit(akka.testkit.javadsl.TestKit) SUCCESS(io.mantisrx.master.jobcluster.proto.BaseResponse.ResponseCode.SUCCESS) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) JobClusterManagerProto(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto) Mockito(org.mockito.Mockito) Lists(io.mantisrx.shaded.com.google.common.collect.Lists) UpdateJobClusterArtifactRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterArtifactRequest) JobClusterActor.props(io.mantisrx.master.jobcluster.JobClusterActor.props) IMantisStageMetadata(io.mantisrx.master.jobcluster.job.IMantisStageMetadata) DeploymentStrategy(io.mantisrx.runtime.descriptor.DeploymentStrategy) LifecycleEventPublisher(io.mantisrx.master.events.LifecycleEventPublisher) WorkerHeartbeat(io.mantisrx.master.jobcluster.job.worker.WorkerHeartbeat) JobClusterProto(io.mantisrx.master.jobcluster.proto.JobClusterProto) GetJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterResponse) ActorRef(akka.actor.ActorRef) GetJobDetailsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobDetailsRequest) IMantisJobMetadata(io.mantisrx.master.jobcluster.job.IMantisJobMetadata) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) TestKit(akka.testkit.javadsl.TestKit) Matchers.anyString(org.mockito.Matchers.anyString) CountDownLatch(java.util.concurrent.CountDownLatch) InvalidJobException(io.mantisrx.runtime.command.InvalidJobException) GetJobDetailsResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobDetailsResponse) DisableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterResponse) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) GetJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterRequest) Test(org.junit.Test)

Example 2 with DisableJobClusterRequest

use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest in project mantis by Netflix.

the class JobClusterManagerTest method testJobClusterEnable.

@Test
public void testJobClusterEnable() throws MalformedURLException {
    TestKit probe = new TestKit(system);
    String clusterName = "testJobClusterEnable";
    List<Label> labels = Lists.newLinkedList();
    final JobClusterDefinitionImpl fakeJobCluster = createFakeJobClusterDefn(clusterName, labels);
    jobClusterManagerActor.tell(new JobClusterManagerProto.CreateJobClusterRequest(fakeJobCluster, "user"), probe.getRef());
    JobClusterManagerProto.CreateJobClusterResponse createResp = probe.expectMsgClass(JobClusterManagerProto.CreateJobClusterResponse.class);
    assertEquals(SUCCESS_CREATED, createResp.responseCode);
    DisableJobClusterRequest req = new JobClusterManagerProto.DisableJobClusterRequest(clusterName, "user");
    jobClusterManagerActor.tell(req, probe.getRef());
    JobClusterManagerProto.DisableJobClusterResponse updateResp = probe.expectMsgClass(JobClusterManagerProto.DisableJobClusterResponse.class);
    assertEquals(SUCCESS, updateResp.responseCode);
    jobClusterManagerActor.tell(new GetJobClusterRequest(clusterName), probe.getRef());
    GetJobClusterResponse getResp = probe.expectMsgClass(GetJobClusterResponse.class);
    assertEquals(SUCCESS, getResp.responseCode);
    assertTrue(getResp.getJobCluster().get().isDisabled());
    EnableJobClusterRequest req2 = new JobClusterManagerProto.EnableJobClusterRequest(clusterName, "user");
    jobClusterManagerActor.tell(req2, probe.getRef());
    JobClusterManagerProto.EnableJobClusterResponse updateResp2 = probe.expectMsgClass(JobClusterManagerProto.EnableJobClusterResponse.class);
    assertEquals(SUCCESS, updateResp2.responseCode);
    jobClusterManagerActor.tell(new GetJobClusterRequest(clusterName), probe.getRef());
    getResp = probe.expectMsgClass(GetJobClusterResponse.class);
    assertEquals(SUCCESS, getResp.responseCode);
    assertFalse(getResp.getJobCluster().get().isDisabled());
}
Also used : GetJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterResponse) Label(io.mantisrx.common.Label) JobClusterDefinitionImpl(io.mantisrx.server.master.domain.JobClusterDefinitionImpl) TestKit(akka.testkit.javadsl.TestKit) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) EnableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterRequest) GetJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterRequest) JobClusterManagerProto(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto) Test(org.junit.Test)

Example 3 with DisableJobClusterRequest

use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest in project mantis by Netflix.

the class JobClusterTest method testJobClusterDeletePurgesCompletedJobs.

@Test
public void testJobClusterDeletePurgesCompletedJobs() throws Exception {
    TestKit probe = new TestKit(system);
    List<Label> labels = Lists.newLinkedList();
    Label l = new Label("labelname", "labelvalue");
    labels.add(l);
    String clusterName = "testJobClusterDeletePurgesCompletedJobs";
    MantisScheduler schedulerMock = mock(MantisScheduler.class);
    MantisJobStore jobStoreMock = mock(MantisJobStore.class);
    final JobClusterDefinitionImpl fakeJobCluster = createFakeJobClusterDefn(clusterName, labels);
    ActorRef jobClusterActor = system.actorOf(props(clusterName, jobStoreMock, schedulerMock, eventPublisher));
    jobClusterActor.tell(new JobClusterProto.InitializeJobClusterRequest(fakeJobCluster, user, probe.getRef()), probe.getRef());
    JobClusterProto.InitializeJobClusterResponse createResp = probe.expectMsgClass(JobClusterProto.InitializeJobClusterResponse.class);
    assertEquals(SUCCESS, createResp.responseCode);
    final JobDefinition jobDefn = createJob(clusterName, 1, MantisJobDurationType.Transient);
    String jobId = clusterName + "-1";
    JobTestHelper.submitJobAndVerifySuccess(probe, clusterName, jobClusterActor, jobDefn, jobId);
    JobTestHelper.getJobDetailsAndVerify(probe, jobClusterActor, jobId, SUCCESS, JobState.Accepted);
    jobClusterActor.tell(new DisableJobClusterRequest(clusterName, "user"), probe.getRef());
    DisableJobClusterResponse disableResp = probe.expectMsgClass(DisableJobClusterResponse.class);
    assertEquals(SUCCESS, disableResp.responseCode);
    Thread.sleep(1000);
    jobClusterActor.tell(new JobClusterProto.DeleteJobClusterRequest(user, clusterName, probe.getRef()), probe.getRef());
    JobClusterProto.DeleteJobClusterResponse resp4 = probe.expectMsgClass(JobClusterProto.DeleteJobClusterResponse.class);
    assertEquals(SUCCESS, resp4.responseCode);
    assertEquals(jobClusterActor, probe.getLastSender());
    verify(jobStoreMock, times(1)).createJobCluster(any());
    verify(jobStoreMock, times(2)).updateJobCluster(any());
    verify(jobStoreMock, times(1)).deleteJobCluster(clusterName);
    verify(jobStoreMock, times(1)).storeCompletedJobForCluster(any(), any());
    verify(jobStoreMock, times(1)).deleteJob("testJobClusterDeletePurgesCompletedJobs-1");
}
Also used : JobClusterProto(io.mantisrx.master.jobcluster.proto.JobClusterProto) ActorRef(akka.actor.ActorRef) Label(io.mantisrx.common.Label) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) TestKit(akka.testkit.javadsl.TestKit) Matchers.anyString(org.mockito.Matchers.anyString) DisableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterResponse) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) Test(org.junit.Test)

Example 4 with DisableJobClusterRequest

use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest in project mantis by Netflix.

the class JobClusterRoute method getJobClusterRoutes.

private Route getJobClusterRoutes() {
    return route(path(segment("api").slash("submit"), () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/submit called {}", request);
        try {
            MantisJobDefinition mjd = Jackson.fromJSON(request, MantisJobDefinition.class);
            logger.debug("job submit request {}", mjd);
            mjd.validate(true);
            Pair<Boolean, String> validationResult = validateSubmitJobRequest(mjd);
            if (!validationResult.first()) {
                jobClusterSubmitError.increment();
                return complete(StatusCodes.BAD_REQUEST, "{\"error\": \"" + validationResult.second() + "\"}");
            }
            jobClusterSubmit.increment();
            return completeWithFuture(jobClusterRouteHandler.submit(JobClusterProtoAdapter.toSubmitJobClusterRequest(mjd)).thenApply(this::toHttpResponse));
        } catch (Exception e) {
            logger.warn("exception in submit job request {}", request, e);
            jobClusterSubmitError.increment();
            return complete(StatusCodes.INTERNAL_SERVER_ERROR, "{\"error\": \"" + e.getMessage() + "\"}");
        }
    }))), pathPrefix(API_V0_JOBCLUSTER, () -> route(post(() -> route(path("create", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), jobClusterDefn -> {
        logger.debug("/api/namedjob/create called {}", jobClusterDefn);
        try {
            final NamedJobDefinition namedJobDefinition = Jackson.fromJSON(jobClusterDefn, NamedJobDefinition.class);
            if (namedJobDefinition == null || namedJobDefinition.getJobDefinition() == null || namedJobDefinition.getJobDefinition().getJobJarFileLocation() == null || namedJobDefinition.getJobDefinition().getName() == null || namedJobDefinition.getJobDefinition().getName().isEmpty()) {
                logger.warn("JobCluster create request must include name and URL {}", jobClusterDefn);
                return complete(StatusCodes.BAD_REQUEST, "{\"error\": \"Job definition must include name and URL\"}");
            }
            final CompletionStage<CreateJobClusterResponse> response = jobClusterRouteHandler.create(JobClusterProtoAdapter.toCreateJobClusterRequest(namedJobDefinition));
            jobClusterCreate.increment();
            return completeWithFuture(response.thenApply(r -> {
                if ((r.responseCode == CLIENT_ERROR || r.responseCode == CLIENT_ERROR_CONFLICT) && r.message.contains("already exists")) {
                    return new CreateJobClusterResponse(r.requestId, SERVER_ERROR, r.message, r.getJobClusterName());
                }
                return r;
            }).thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error creating JobCluster {}", jobClusterDefn, e);
            jobClusterCreateError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't read valid json in request: " + e.getMessage());
        } catch (Exception e) {
            logger.warn("Error creating JobCluster {}", jobClusterDefn, e);
            jobClusterCreateError.increment();
            return complete(StatusCodes.INTERNAL_SERVER_ERROR, "{\"error\": " + e.getMessage() + "}");
        }
    }))), path("update", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), jobClusterDefn -> {
        logger.debug("/api/namedjob/update called {}", jobClusterDefn);
        try {
            final NamedJobDefinition namedJobDefinition = Jackson.fromJSON(jobClusterDefn, NamedJobDefinition.class);
            if (namedJobDefinition == null || namedJobDefinition.getJobDefinition() == null || namedJobDefinition.getJobDefinition().getJobJarFileLocation() == null || namedJobDefinition.getJobDefinition().getName() == null || namedJobDefinition.getJobDefinition().getName().isEmpty()) {
                logger.warn("JobCluster update request must include name and URL {}", jobClusterDefn);
                jobClusterCreateUpdateError.increment();
                return complete(StatusCodes.BAD_REQUEST, "{\"error\": \"Job definition must include name and URL\"}");
            }
            final CompletionStage<UpdateJobClusterResponse> response = jobClusterRouteHandler.update(JobClusterProtoAdapter.toUpdateJobClusterRequest(namedJobDefinition));
            jobClusterCreateUpdate.increment();
            return completeWithFuture(response.thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error updating JobCluster {}", jobClusterDefn, e);
            jobClusterCreateUpdateError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't read valid json in request: " + e.getMessage());
        } catch (Exception e) {
            logger.warn("Error updating JobCluster {}", jobClusterDefn, e);
            jobClusterCreateUpdateError.increment();
            return complete(StatusCodes.INTERNAL_SERVER_ERROR, "{\"error\": " + e.getMessage() + "}");
        }
    }))), path("delete", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), deleteReq -> {
        logger.debug("/api/namedjob/delete called {}", deleteReq);
        try {
            final DeleteJobClusterRequest deleteJobClusterRequest = Jackson.fromJSON(deleteReq, DeleteJobClusterRequest.class);
            final CompletionStage<DeleteJobClusterResponse> response = jobClusterRouteHandler.delete(deleteJobClusterRequest);
            jobClusterDelete.increment();
            return completeWithFuture(response.thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error deleting JobCluster {}", deleteReq, e);
            jobClusterDeleteError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("disable", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/disable called {}", request);
        try {
            final DisableJobClusterRequest disableJobClusterRequest = Jackson.fromJSON(request, DisableJobClusterRequest.class);
            final CompletionStage<DisableJobClusterResponse> response = jobClusterRouteHandler.disable(disableJobClusterRequest);
            jobClusterDisable.increment();
            return completeWithFuture(response.thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error disabling JobCluster {}", request, e);
            jobClusterDisableError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("enable", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/enable called {}", request);
        try {
            final EnableJobClusterRequest enableJobClusterRequest = Jackson.fromJSON(request, EnableJobClusterRequest.class);
            final CompletionStage<EnableJobClusterResponse> response = jobClusterRouteHandler.enable(enableJobClusterRequest);
            jobClusterEnable.increment();
            return completeWithFuture(response.thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error enabling JobCluster {}", request, e);
            jobClusterEnableError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("quickupdate", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/quickupdate called {}", request);
        try {
            final UpdateJobClusterArtifactRequest updateJobClusterArtifactRequest = Jackson.fromJSON(request, UpdateJobClusterArtifactRequest.class);
            final CompletionStage<UpdateJobClusterArtifactResponse> response = jobClusterRouteHandler.updateArtifact(updateJobClusterArtifactRequest);
            jobClusterQuickupdate.increment();
            return completeWithFuture(response.thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error on quickupdate for JobCluster {}", request, e);
            jobClusterQuickupdateError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("updatelabels", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/updatelabels called {}", request);
        try {
            final UpdateJobClusterLabelsRequest updateJobClusterLabelsRequest = Jackson.fromJSON(request, UpdateJobClusterLabelsRequest.class);
            jobClusterUpdateLabel.increment();
            return completeWithFuture(jobClusterRouteHandler.updateLabels(updateJobClusterLabelsRequest).thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error updating labels for JobCluster {}", request, e);
            jobClusterUpdateLabelError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("updatesla", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/updatesla called {}", request);
        jobClusterUpdateSla.increment();
        try {
            final UpdateJobClusterSLARequest updateJobClusterSLARequest = Jackson.fromJSON(request, UpdateJobClusterSLARequest.class);
            return completeWithFuture(jobClusterRouteHandler.updateSLA(updateJobClusterSLARequest).thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error updating SLA for JobCluster {}", request, e);
            jobClusterUpdateSlaError.increment();
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("migratestrategy", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/migratestrategy called {}", request);
        try {
            final UpdateJobClusterWorkerMigrationStrategyRequest updateMigrateStrategyReq = Jackson.fromJSON(request, UpdateJobClusterWorkerMigrationStrategyRequest.class);
            return completeWithFuture(jobClusterRouteHandler.updateWorkerMigrateStrategy(updateMigrateStrategyReq).thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error updating migrate strategy for JobCluster {}", request, e);
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))), path("quicksubmit", () -> decodeRequest(() -> entity(Unmarshaller.entityToString(), request -> {
        logger.debug("/api/namedjob/quicksubmit called {}", request);
        try {
            final JobClusterManagerProto.SubmitJobRequest submitJobRequest = Jackson.fromJSON(request, JobClusterManagerProto.SubmitJobRequest.class);
            return completeWithFuture(jobClusterRouteHandler.submit(submitJobRequest).thenApply(this::toHttpResponse));
        } catch (IOException e) {
            logger.warn("Error on quick submit for JobCluster {}", request, e);
            return complete(StatusCodes.BAD_REQUEST, "Can't find valid json in request: " + e.getMessage());
        }
    }))))), get(() -> route(pathPrefix("list", () -> route(pathEndOrSingleSlash(() -> {
        logger.debug("/api/namedjob/list called");
        jobClusterListGET.increment();
        return alwaysCache(cache, requestUriKeyer, () -> extractUri(uri -> completeAsync(jobClusterRouteHandler.getAllJobClusters(new ListJobClustersRequest()), resp -> completeOK(resp.getJobClusters().stream().map(jobClusterMetadataView -> JobClusterProtoAdapter.toJobClusterInfo(jobClusterMetadataView)).collect(Collectors.toList()), Jackson.marshaller()), resp -> completeOK(Collections.emptyList(), Jackson.marshaller()))));
    }), path(PathMatchers.segment(), (jobCluster) -> {
        if (logger.isDebugEnabled()) {
            logger.debug("/api/namedjob/list/{} called", jobCluster);
        }
        jobClusterListClusterGET.increment();
        return completeAsync(jobClusterRouteHandler.getJobClusterDetails(new JobClusterManagerProto.GetJobClusterRequest(jobCluster)), resp -> completeOK(resp.getJobCluster().map(jc -> Arrays.asList(jc)).orElse(Collections.emptyList()), Jackson.marshaller()), resp -> completeOK(Collections.emptyList(), Jackson.marshaller()));
    }))), path(segment("listJobIds").slash(PathMatchers.segment()), (jobCluster) -> {
        logger.debug("/api/namedjob/listJobIds/{} called", jobCluster);
        jobClusterListJobIdGET.increment();
        return jobClusterListRoute(jobCluster);
    }), path("listJobIds", () -> {
        logger.debug("/api/namedjob/listJobIds called");
        return complete(StatusCodes.BAD_REQUEST, "Specify the Job cluster name '/api/namedjob/listJobIds/<JobClusterName>' to list the job Ids");
    }))))));
}
Also used : Strings(io.mantisrx.shaded.com.google.common.base.Strings) EnableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterResponse) Uri(akka.http.javadsl.model.Uri) MasterConfiguration(io.mantisrx.server.master.config.MasterConfiguration) Arrays(java.util.Arrays) JavaPartialFunction(akka.japi.JavaPartialFunction) Cache(akka.http.caching.javadsl.Cache) JobRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobRouteHandler) LoggerFactory(org.slf4j.LoggerFactory) LfuCache(akka.http.caching.LfuCache) RequestContext(akka.http.javadsl.server.RequestContext) StageSchedulingInfo(io.mantisrx.runtime.descriptor.StageSchedulingInfo) PathMatchers.segment(akka.http.javadsl.server.PathMatchers.segment) MantisJobDefinition(io.mantisrx.runtime.MantisJobDefinition) CLIENT_ERROR(io.mantisrx.master.jobcluster.proto.BaseResponse.ResponseCode.CLIENT_ERROR) StringUnmarshallers(akka.http.javadsl.unmarshalling.StringUnmarshallers) PathMatcher0(akka.http.javadsl.server.PathMatcher0) LfuCacheSettings(akka.http.caching.javadsl.LfuCacheSettings) UpdateJobClusterArtifactResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterArtifactResponse) DeleteJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DeleteJobClusterRequest) Map(java.util.Map) JobClusterProtoAdapter(io.mantisrx.master.api.akka.route.proto.JobClusterProtoAdapter) Unmarshaller(akka.http.javadsl.unmarshalling.Unmarshaller) Metrics(io.mantisrx.common.metrics.Metrics) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) DisableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterResponse) Jackson(io.mantisrx.master.api.akka.route.Jackson) UpdateJobClusterLabelsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterLabelsRequest) HttpMethods(akka.http.javadsl.model.HttpMethods) Collectors(java.util.stream.Collectors) ExceptionHandler(akka.http.javadsl.server.ExceptionHandler) JobClusterRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandler) Duration(scala.concurrent.duration.Duration) CompletionStage(java.util.concurrent.CompletionStage) UpdateJobClusterWorkerMigrationStrategyRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterWorkerMigrationStrategyRequest) JobRouteUtils.createListJobIdsRequest(io.mantisrx.master.api.akka.route.utils.JobRouteUtils.createListJobIdsRequest) CachingDirectives.alwaysCache(akka.http.javadsl.server.directives.CachingDirectives.alwaysCache) ActorSystem(akka.actor.ActorSystem) ConfigurationProvider(io.mantisrx.server.master.config.ConfigurationProvider) StageScalingPolicy(io.mantisrx.runtime.descriptor.StageScalingPolicy) Optional(java.util.Optional) CLIENT_ERROR_CONFLICT(io.mantisrx.master.jobcluster.proto.BaseResponse.ResponseCode.CLIENT_ERROR_CONFLICT) UpdateJobClusterSLARequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterSLARequest) SERVER_ERROR(io.mantisrx.master.jobcluster.proto.BaseResponse.ResponseCode.SERVER_ERROR) UpdateJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterResponse) ListJobClustersRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobClustersRequest) Route(akka.http.javadsl.server.Route) MetricsRegistry(io.mantisrx.common.metrics.MetricsRegistry) StatusCodes(akka.http.javadsl.model.StatusCodes) Function(java.util.function.Function) PathMatchers(akka.http.javadsl.server.PathMatchers) DeleteJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DeleteJobClusterResponse) SchedulingInfo(io.mantisrx.runtime.descriptor.SchedulingInfo) Counter(io.mantisrx.common.metrics.Counter) Logger(org.slf4j.Logger) RouteResult(akka.http.javadsl.server.RouteResult) HttpHeader(akka.http.javadsl.model.HttpHeader) HttpRequest(akka.http.javadsl.model.HttpRequest) NamedJobDefinition(io.mantisrx.runtime.NamedJobDefinition) EnableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterRequest) IOException(java.io.IOException) CreateJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.CreateJobClusterResponse) Pair(akka.japi.Pair) TimeUnit(java.util.concurrent.TimeUnit) JobClusterManagerProto(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto) UpdateJobClusterArtifactRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterArtifactRequest) CachingSettings(akka.http.caching.javadsl.CachingSettings) Collections(java.util.Collections) UpdateJobClusterLabelsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterLabelsRequest) UpdateJobClusterSLARequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterSLARequest) MantisJobDefinition(io.mantisrx.runtime.MantisJobDefinition) ListJobClustersRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListJobClustersRequest) IOException(java.io.IOException) IOException(java.io.IOException) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) UpdateJobClusterArtifactRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterArtifactRequest) EnableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterRequest) UpdateJobClusterWorkerMigrationStrategyRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.UpdateJobClusterWorkerMigrationStrategyRequest) DeleteJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DeleteJobClusterRequest) NamedJobDefinition(io.mantisrx.runtime.NamedJobDefinition) CreateJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.CreateJobClusterResponse) CompletionStage(java.util.concurrent.CompletionStage) Pair(akka.japi.Pair) JobClusterManagerProto(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto)

Example 5 with DisableJobClusterRequest

use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest in project mantis by Netflix.

the class JobClusterTest method testJobClusterEnable.

@Test
public void testJobClusterEnable() {
    try {
        TestKit probe = new TestKit(system);
        String clusterName = "testJobClusterEnable";
        MantisScheduler schedulerMock = mock(MantisScheduler.class);
        MantisJobStore jobStoreMock = mock(MantisJobStore.class);
        String jobId = clusterName + "-1";
        JobDefinition jobDefn = createJob(clusterName);
        IMantisJobMetadata job1 = new MantisJobMetadataImpl.Builder().withJobDefinition(jobDefn).withJobState(JobState.Completed).withJobId(new JobId(clusterName, 1)).withNextWorkerNumToUse(2).withSubmittedAt(1000).build();
        when(jobStoreMock.getArchivedJob(jobId)).thenReturn(of(job1));
        SLA sla = new SLA(1, 1, null, null);
        final JobClusterDefinitionImpl fakeJobCluster = createFakeJobClusterDefn(clusterName, Lists.newArrayList(), sla);
        ActorRef jobClusterActor = system.actorOf(props(clusterName, jobStoreMock, schedulerMock, eventPublisher));
        jobClusterActor.tell(new JobClusterProto.InitializeJobClusterRequest(fakeJobCluster, user, probe.getRef()), probe.getRef());
        JobClusterProto.InitializeJobClusterResponse createResp = probe.expectMsgClass(JobClusterProto.InitializeJobClusterResponse.class);
        assertEquals(SUCCESS, createResp.responseCode);
        JobTestHelper.submitJobAndVerifySuccess(probe, clusterName, jobClusterActor, jobDefn, jobId);
        JobTestHelper.getJobDetailsAndVerify(probe, jobClusterActor, jobId, SUCCESS, JobState.Accepted);
        JobTestHelper.sendLaunchedInitiatedStartedEventsToWorker(probe, jobClusterActor, jobId, 1, new WorkerId(clusterName, jobId, 0, 1));
        JobTestHelper.getJobDetailsAndVerify(probe, jobClusterActor, jobId, SUCCESS, JobState.Launched);
        jobClusterActor.tell(new DisableJobClusterRequest(clusterName, user), probe.getRef());
        DisableJobClusterResponse resp = probe.expectMsgClass(DisableJobClusterResponse.class);
        assertTrue(BaseResponse.ResponseCode.SUCCESS.equals(resp.responseCode));
        jobClusterActor.tell(new EnableJobClusterRequest(clusterName, user), probe.getRef());
        EnableJobClusterResponse enableResp = probe.expectMsgClass(EnableJobClusterResponse.class);
        assertTrue(BaseResponse.ResponseCode.SUCCESS.equals(enableResp.responseCode));
        // first job was killed during disable
        JobTestHelper.getJobDetailsAndVerify(probe, jobClusterActor, jobId, SUCCESS, JobState.Completed);
        // Sla will cause new job to get launched
        String jobId2 = clusterName + "-2";
        boolean accepted = false;
        int cnt = 0;
        // try a few times for timing issue
        while (cnt < 50) {
            jobClusterActor.tell(new GetJobDetailsRequest("nj", JobId.fromId(jobId2).get()), probe.getRef());
            GetJobDetailsResponse detailsResp = probe.expectMsgClass(GetJobDetailsResponse.class);
            if (detailsResp.responseCode.equals(BaseResponse.ResponseCode.SUCCESS)) {
                accepted = true;
                break;
            }
            Thread.sleep(1000);
        }
        assertTrue(accepted);
    // JobTestHelper.getJobDetailsAndVerify(probe, jobClusterActor, jobId, SUCCESS, JobState.Completed);
    // JobTestHelper.killJobAndVerify(probe, clusterName, new JobId(clusterName, 2), jobClusterActor);
    // verify(jobStoreMock, times(1)).createJobCluster(any());
    // verify(jobStoreMock, times(1)).updateJobCluster(any());
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        fail();
    }
// Mockito.doThrow(IOException.class).when(jobStoreMock).storeNewJob(any());
}
Also used : JobClusterProto(io.mantisrx.master.jobcluster.proto.JobClusterProto) ActorRef(akka.actor.ActorRef) GetJobDetailsRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobDetailsRequest) IMantisJobMetadata(io.mantisrx.master.jobcluster.job.IMantisJobMetadata) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) TestKit(akka.testkit.javadsl.TestKit) Matchers.anyString(org.mockito.Matchers.anyString) WorkerId(io.mantisrx.server.core.domain.WorkerId) InvalidJobException(io.mantisrx.runtime.command.InvalidJobException) GetJobDetailsResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobDetailsResponse) EnableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterResponse) DisableJobClusterResponse(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterResponse) DisableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) EnableJobClusterRequest(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterRequest) Test(org.junit.Test)

Aggregations

DisableJobClusterRequest (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterRequest)6 TestKit (akka.testkit.javadsl.TestKit)5 Test (org.junit.Test)5 Label (io.mantisrx.common.Label)4 JobClusterManagerProto (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto)4 DisableJobClusterResponse (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.DisableJobClusterResponse)4 EnableJobClusterRequest (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterRequest)4 ActorRef (akka.actor.ActorRef)3 ActorSystem (akka.actor.ActorSystem)2 JobClusterProtoAdapter (io.mantisrx.master.api.akka.route.proto.JobClusterProtoAdapter)2 IMantisJobMetadata (io.mantisrx.master.jobcluster.job.IMantisJobMetadata)2 EnableJobClusterResponse (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.EnableJobClusterResponse)2 GetJobClusterRequest (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterRequest)2 GetJobClusterResponse (io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.GetJobClusterResponse)2 JobClusterProto (io.mantisrx.master.jobcluster.proto.JobClusterProto)2 MantisJobStore (io.mantisrx.server.master.persistence.MantisJobStore)2 MantisScheduler (io.mantisrx.server.master.scheduler.MantisScheduler)2 Matchers.anyString (org.mockito.Matchers.anyString)2 LfuCache (akka.http.caching.LfuCache)1 Cache (akka.http.caching.javadsl.Cache)1