Search in sources :

Example 6 with Http

use of akka.http.javadsl.Http in project mantis by Netflix.

the class MantisMasterAPI method main.

public static void main(String[] args) throws Exception {
    // boot up server using the route as defined below
    int port = 8182;
    TestHelpers.setupMasterConfig();
    ActorSystem system = ActorSystem.create("MantisMasterAPI");
    final ActorRef actor = system.actorOf(Props.create(DeadLetterActor.class));
    system.eventStream().subscribe(actor, DeadLetter.class);
    final Http http = Http.get(system);
    final ActorMaterializer materializer = ActorMaterializer.create(system);
    final AuditEventSubscriber auditEventSubscriber = new AuditEventSubscriberLoggingImpl();
    ActorRef auditEventBrokerActor = system.actorOf(AuditEventBrokerActor.props(auditEventSubscriber), "AuditEventBroker");
    final AuditEventSubscriber auditEventSubscriberAkka = new AuditEventSubscriberAkkaImpl(auditEventBrokerActor);
    final LifecycleEventPublisher lifecycleEventPublisher = new LifecycleEventPublisherImpl(auditEventSubscriberAkka, new StatusEventSubscriberLoggingImpl(), new WorkerEventSubscriberLoggingImpl());
    IMantisStorageProvider storageProvider = new MantisStorageProviderAdapter(new SimpleCachedFileStorageProvider(), lifecycleEventPublisher);
    ActorRef jobClustersManager = system.actorOf(JobClustersManagerActor.props(new MantisJobStore(storageProvider), lifecycleEventPublisher), "JobClustersManager");
    final FakeMantisScheduler fakeScheduler = new FakeMantisScheduler(jobClustersManager);
    jobClustersManager.tell(new JobClusterManagerProto.JobClustersManagerInitialize(fakeScheduler, true), ActorRef.noSender());
    // Schedulers.newThread().createWorker().schedulePeriodically(() -> jobClustersManager.tell(new NullPointerException(), ActorRef.noSender()),0, 100, TimeUnit.SECONDS);
    setupDummyAgentClusterAutoScaler();
    final JobClusterRouteHandler jobClusterRouteHandler = new JobClusterRouteHandlerAkkaImpl(jobClustersManager);
    final JobRouteHandler jobRouteHandler = new JobRouteHandlerAkkaImpl(jobClustersManager);
    MasterDescription masterDescription = new MasterDescription("localhost", "127.0.0.1", port, port + 2, port + 4, "api/postjobstatus", port + 6, System.currentTimeMillis());
    final MasterDescriptionRoute masterDescriptionRoute = new MasterDescriptionRoute(masterDescription);
    Duration idleTimeout = system.settings().config().getDuration("akka.http.server.idle-timeout");
    logger.info("idle timeout {} sec ", idleTimeout.getSeconds());
    ActorRef agentsErrorMonitorActor = system.actorOf(AgentsErrorMonitorActor.props(), "AgentsErrorMonitor");
    ActorRef statusEventBrokerActor = system.actorOf(StatusEventBrokerActor.props(agentsErrorMonitorActor), "StatusEventBroker");
    agentsErrorMonitorActor.tell(new AgentsErrorMonitorActor.InitializeAgentsErrorMonitor(fakeScheduler), ActorRef.noSender());
    final JobStatusRouteHandler jobStatusRouteHandler = new JobStatusRouteHandlerAkkaImpl(system, statusEventBrokerActor);
    final AgentClusterOperationsImpl agentClusterOperations = new AgentClusterOperationsImpl(storageProvider, new JobMessageRouterImpl(jobClustersManager), fakeScheduler, lifecycleEventPublisher, "cluster");
    final JobDiscoveryRouteHandler jobDiscoveryRouteHandler = new JobDiscoveryRouteHandlerAkkaImpl(jobClustersManager, idleTimeout);
    final JobRoute v0JobRoute = new JobRoute(jobRouteHandler, system);
    final JobDiscoveryRoute v0JobDiscoveryRoute = new JobDiscoveryRoute(jobDiscoveryRouteHandler);
    final JobClusterRoute v0JobClusterRoute = new JobClusterRoute(jobClusterRouteHandler, jobRouteHandler, system);
    final JobStatusRoute v0JobStatusRoute = new JobStatusRoute(jobStatusRouteHandler);
    final AgentClusterRoute v0AgentClusterRoute = new AgentClusterRoute(agentClusterOperations, system);
    final JobClustersRoute v1JobClustersRoute = new JobClustersRoute(jobClusterRouteHandler, system);
    final JobsRoute v1JobsRoute = new JobsRoute(jobClusterRouteHandler, jobRouteHandler, system);
    final AdminMasterRoute v1AdminMasterRoute = new AdminMasterRoute(masterDescription);
    final AgentClustersRoute v1AgentClustersRoute = new AgentClustersRoute(agentClusterOperations);
    final JobDiscoveryStreamRoute v1JobDiscoveryStreamRoute = new JobDiscoveryStreamRoute(jobDiscoveryRouteHandler);
    final LastSubmittedJobIdStreamRoute v1LastSubmittedJobIdStreamRoute = new LastSubmittedJobIdStreamRoute(jobDiscoveryRouteHandler);
    final JobStatusStreamRoute v1JobStatusStreamRoute = new JobStatusStreamRoute(jobStatusRouteHandler);
    LocalMasterMonitor localMasterMonitor = new LocalMasterMonitor(masterDescription);
    LeadershipManagerLocalImpl leadershipMgr = new LeadershipManagerLocalImpl(masterDescription);
    leadershipMgr.setLeaderReady();
    LeaderRedirectionFilter leaderRedirectionFilter = new LeaderRedirectionFilter(localMasterMonitor, leadershipMgr);
    final MantisMasterRoute app = new MantisMasterRoute(leaderRedirectionFilter, masterDescriptionRoute, v0JobClusterRoute, v0JobRoute, v0JobDiscoveryRoute, v0JobStatusRoute, v0AgentClusterRoute, v1JobClustersRoute, v1JobsRoute, v1AdminMasterRoute, v1AgentClustersRoute, v1JobDiscoveryStreamRoute, v1LastSubmittedJobIdStreamRoute, v1JobStatusStreamRoute);
    final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = app.createRoute().flow(system, materializer);
    final CompletionStage<ServerBinding> binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("localhost", port), materializer);
    binding.exceptionally(failure -> {
        System.err.println("Something very bad happened! " + failure.getMessage());
        system.terminate();
        return null;
    });
    // Schedulers.newThread().createWorker().schedule(() -> leadershipMgr.stopBeingLeader(), 10, TimeUnit.SECONDS);
    System.out.println("Server online at http://localhost:" + port + "/\nPress RETURN to stop...");
    // let it run until user presses return
    System.in.read();
    binding.thenCompose(// trigger unbinding from the port
    ServerBinding::unbind).thenAccept(// and shutdown when done
    unbound -> system.terminate());
}
Also used : JobClusterRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandler) AgentClusterRoute(io.mantisrx.master.api.akka.route.v0.AgentClusterRoute) FakeMantisScheduler(io.mantisrx.master.scheduler.FakeMantisScheduler) ActorRef(akka.actor.ActorRef) JobClusterRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandlerAkkaImpl) JobClusterRoute(io.mantisrx.master.api.akka.route.v0.JobClusterRoute) Http(akka.http.javadsl.Http) ConnectHttp(akka.http.javadsl.ConnectHttp) JobStatusStreamRoute(io.mantisrx.master.api.akka.route.v1.JobStatusStreamRoute) NotUsed(akka.NotUsed) AgentsErrorMonitorActor(io.mantisrx.master.scheduler.AgentsErrorMonitorActor) ActorMaterializer(akka.stream.ActorMaterializer) JobStatusRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobStatusRouteHandlerAkkaImpl) LifecycleEventPublisherImpl(io.mantisrx.master.events.LifecycleEventPublisherImpl) DeadLetterActor(io.mantisrx.master.DeadLetterActor) AgentClusterOperationsImpl(io.mantisrx.master.vm.AgentClusterOperationsImpl) JobStatusRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobStatusRouteHandler) LastSubmittedJobIdStreamRoute(io.mantisrx.master.api.akka.route.v1.LastSubmittedJobIdStreamRoute) IMantisStorageProvider(io.mantisrx.server.master.persistence.IMantisStorageProvider) Duration(java.time.Duration) LeaderRedirectionFilter(io.mantisrx.server.master.LeaderRedirectionFilter) AuditEventSubscriberAkkaImpl(io.mantisrx.master.events.AuditEventSubscriberAkkaImpl) AuditEventSubscriberLoggingImpl(io.mantisrx.master.events.AuditEventSubscriberLoggingImpl) JobMessageRouterImpl(io.mantisrx.master.scheduler.JobMessageRouterImpl) JobDiscoveryRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandler) JobClustersRoute(io.mantisrx.master.api.akka.route.v1.JobClustersRoute) AuditEventSubscriber(io.mantisrx.master.events.AuditEventSubscriber) ActorSystem(akka.actor.ActorSystem) JobRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobRouteHandlerAkkaImpl) MasterDescriptionRoute(io.mantisrx.master.api.akka.route.v0.MasterDescriptionRoute) JobRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobRouteHandler) MasterDescription(io.mantisrx.server.core.master.MasterDescription) StatusEventSubscriberLoggingImpl(io.mantisrx.master.events.StatusEventSubscriberLoggingImpl) JobDiscoveryRoute(io.mantisrx.master.api.akka.route.v0.JobDiscoveryRoute) JobDiscoveryStreamRoute(io.mantisrx.master.api.akka.route.v1.JobDiscoveryStreamRoute) SimpleCachedFileStorageProvider(io.mantisrx.server.master.store.SimpleCachedFileStorageProvider) WorkerEventSubscriberLoggingImpl(io.mantisrx.master.events.WorkerEventSubscriberLoggingImpl) JobClusterManagerProto(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto) HttpRequest(akka.http.javadsl.model.HttpRequest) AdminMasterRoute(io.mantisrx.master.api.akka.route.v1.AdminMasterRoute) AgentClustersRoute(io.mantisrx.master.api.akka.route.v1.AgentClustersRoute) JobStatusRoute(io.mantisrx.master.api.akka.route.v0.JobStatusRoute) HttpResponse(akka.http.javadsl.model.HttpResponse) LifecycleEventPublisher(io.mantisrx.master.events.LifecycleEventPublisher) MantisMasterRoute(io.mantisrx.master.api.akka.route.MantisMasterRoute) JobDiscoveryRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandlerAkkaImpl) ServerBinding(akka.http.javadsl.ServerBinding) MantisStorageProviderAdapter(io.mantisrx.server.master.persistence.MantisStorageProviderAdapter) JobRoute(io.mantisrx.master.api.akka.route.v0.JobRoute) JobsRoute(io.mantisrx.master.api.akka.route.v1.JobsRoute) LocalMasterMonitor(io.mantisrx.server.core.master.LocalMasterMonitor) LeadershipManagerLocalImpl(io.mantisrx.server.master.LeadershipManagerLocalImpl) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore)

Example 7 with Http

use of akka.http.javadsl.Http in project mantis by Netflix.

the class MasterApiAkkaService method startAPIServer.

private void startAPIServer() {
    final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = this.mantisMasterRoute.createRoute().flow(system, materializer);
    final Http http = Http.get(system);
    ServerSettings defaultSettings = ServerSettings.create(system);
    java.time.Duration idleTimeout = system.settings().config().getDuration("akka.http.server.idle-timeout");
    logger.info("idle timeout {} sec ", idleTimeout.getSeconds());
    WebSocketSettings customWebsocketSettings = defaultSettings.getWebsocketSettings().withPeriodicKeepAliveMaxIdle(Duration.create(idleTimeout.getSeconds() - 1, TimeUnit.SECONDS)).withPeriodicKeepAliveMode("pong");
    ServerSettings customServerSettings = defaultSettings.withWebsocketSettings(customWebsocketSettings);
    final CompletionStage<ServerBinding> binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("0.0.0.0", port), customServerSettings, system.log(), materializer);
    binding.exceptionally(failure -> {
        System.err.println("API service exited, committing suicide !" + failure.getMessage());
        logger.info("Master API service exited in error, committing suicide !");
        system.terminate();
        System.exit(2);
        return null;
    });
    logger.info("Starting Mantis Master API on port {}", port);
    try {
        serviceLatch.await();
    } catch (InterruptedException e) {
        logger.error("Master API thread interrupted, committing suicide", e);
        System.exit(2);
    }
    binding.thenCompose(// trigger unbinding from the port
    ServerBinding::unbind).thenAccept(unbound -> {
        logger.error("Master API service unbind, committing suicide");
        system.terminate();
        System.exit(2);
    });
// and shutdown when done
}
Also used : HttpRequest(akka.http.javadsl.model.HttpRequest) ServerSettings(akka.http.javadsl.settings.ServerSettings) HttpResponse(akka.http.javadsl.model.HttpResponse) Http(akka.http.javadsl.Http) ConnectHttp(akka.http.javadsl.ConnectHttp) WebSocketSettings(akka.http.javadsl.settings.WebSocketSettings) NotUsed(akka.NotUsed) ServerBinding(akka.http.javadsl.ServerBinding)

Example 8 with Http

use of akka.http.javadsl.Http in project mantis by Netflix.

the class AgentClusterRouteTest method setup.

@BeforeClass
public static void setup() throws InterruptedException {
    final CountDownLatch latch = new CountDownLatch(1);
    t = new Thread(() -> {
        try {
            // boot up server using the route as defined below
            final Http http = Http.get(system);
            final ActorMaterializer materializer = ActorMaterializer.create(system);
            IMantisStorageProvider storageProvider = new SimpleCachedFileStorageProvider(true);
            final LifecycleEventPublisher lifecycleEventPublisher = new LifecycleEventPublisherImpl(new AuditEventSubscriberLoggingImpl(), new StatusEventSubscriberLoggingImpl(), new WorkerEventSubscriberLoggingImpl());
            ActorRef jobClustersManagerActor = system.actorOf(JobClustersManagerActor.props(new MantisJobStore(storageProvider), lifecycleEventPublisher), "jobClustersManager");
            MantisScheduler fakeScheduler = new FakeMantisScheduler(jobClustersManagerActor);
            jobClustersManagerActor.tell(new JobClusterManagerProto.JobClustersManagerInitialize(fakeScheduler, false), ActorRef.noSender());
            setupDummyAgentClusterAutoScaler();
            final AgentClusterRoute v0AgentClusterRoute = new AgentClusterRoute(new AgentClusterOperationsImpl(storageProvider, new JobMessageRouterImpl(jobClustersManagerActor), fakeScheduler, lifecycleEventPublisher, "cluster"), system);
            final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = v0AgentClusterRoute.createRoute(Function.identity()).flow(system, materializer);
            logger.info("test server starting on port {}", serverPort);
            binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("localhost", serverPort), materializer);
            latch.countDown();
        } catch (Exception e) {
            logger.info("caught exception", e);
            latch.countDown();
            e.printStackTrace();
        }
    });
    t.setDaemon(true);
    t.start();
    latch.await();
}
Also used : FakeMantisScheduler(io.mantisrx.master.scheduler.FakeMantisScheduler) IMantisStorageProvider(io.mantisrx.server.master.persistence.IMantisStorageProvider) StatusEventSubscriberLoggingImpl(io.mantisrx.master.events.StatusEventSubscriberLoggingImpl) ActorRef(akka.actor.ActorRef) Http(akka.http.javadsl.Http) ConnectHttp(akka.http.javadsl.ConnectHttp) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) FakeMantisScheduler(io.mantisrx.master.scheduler.FakeMantisScheduler) LifecycleEventPublisher(io.mantisrx.master.events.LifecycleEventPublisher) CountDownLatch(java.util.concurrent.CountDownLatch) IOException(java.io.IOException) ActorMaterializer(akka.stream.ActorMaterializer) Flow(akka.stream.javadsl.Flow) AuditEventSubscriberLoggingImpl(io.mantisrx.master.events.AuditEventSubscriberLoggingImpl) JobMessageRouterImpl(io.mantisrx.master.scheduler.JobMessageRouterImpl) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) LifecycleEventPublisherImpl(io.mantisrx.master.events.LifecycleEventPublisherImpl) AgentClusterOperationsImpl(io.mantisrx.master.vm.AgentClusterOperationsImpl) SimpleCachedFileStorageProvider(io.mantisrx.server.master.persistence.SimpleCachedFileStorageProvider) WorkerEventSubscriberLoggingImpl(io.mantisrx.master.events.WorkerEventSubscriberLoggingImpl) BeforeClass(org.testng.annotations.BeforeClass)

Example 9 with Http

use of akka.http.javadsl.Http in project mantis by Netflix.

the class JobDiscoveryRouteTest method setup.

@BeforeClass
public static void setup() throws Exception {
    JobTestHelper.deleteAllFiles();
    JobTestHelper.createDirsIfRequired();
    final CountDownLatch latch = new CountDownLatch(1);
    t = new Thread(() -> {
        try {
            // boot up server using the route as defined below
            final Http http = Http.get(system);
            final ActorMaterializer materializer = ActorMaterializer.create(system);
            final LifecycleEventPublisher lifecycleEventPublisher = new LifecycleEventPublisherImpl(new AuditEventSubscriberLoggingImpl(), new StatusEventSubscriberLoggingImpl(), new WorkerEventSubscriberLoggingImpl());
            TestHelpers.setupMasterConfig();
            ActorRef jobClustersManagerActor = system.actorOf(JobClustersManagerActor.props(new MantisJobStore(new io.mantisrx.server.master.persistence.SimpleCachedFileStorageProvider(true)), lifecycleEventPublisher), "jobClustersManager");
            MantisScheduler fakeScheduler = new FakeMantisScheduler(jobClustersManagerActor);
            jobClustersManagerActor.tell(new JobClusterManagerProto.JobClustersManagerInitialize(fakeScheduler, false), ActorRef.noSender());
            agentsErrorMonitorActor.tell(new AgentsErrorMonitorActor.InitializeAgentsErrorMonitor(fakeScheduler), ActorRef.noSender());
            Duration idleTimeout = system.settings().config().getDuration("akka.http.server.idle-timeout");
            logger.info("idle timeout {} sec ", idleTimeout.getSeconds());
            final JobDiscoveryRouteHandler jobDiscoveryRouteHandler = new JobDiscoveryRouteHandlerAkkaImpl(jobClustersManagerActor, idleTimeout);
            final JobDiscoveryRoute jobDiscoveryRoute = new JobDiscoveryRoute(jobDiscoveryRouteHandler);
            final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = jobDiscoveryRoute.createRoute(Function.identity()).flow(system, materializer);
            logger.info("starting test server on port {}", serverPort);
            binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("localhost", serverPort), materializer);
            latch.countDown();
        } catch (Exception e) {
            logger.info("caught exception", e);
            latch.countDown();
            e.printStackTrace();
        }
    });
    t.setDaemon(true);
    t.start();
    latch.await();
}
Also used : FakeMantisScheduler(io.mantisrx.master.scheduler.FakeMantisScheduler) StatusEventSubscriberLoggingImpl(io.mantisrx.master.events.StatusEventSubscriberLoggingImpl) ActorRef(akka.actor.ActorRef) Http(akka.http.javadsl.Http) ConnectHttp(akka.http.javadsl.ConnectHttp) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) FakeMantisScheduler(io.mantisrx.master.scheduler.FakeMantisScheduler) Duration(java.time.Duration) LifecycleEventPublisher(io.mantisrx.master.events.LifecycleEventPublisher) CountDownLatch(java.util.concurrent.CountDownLatch) JobDiscoveryRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandlerAkkaImpl) ActorMaterializer(akka.stream.ActorMaterializer) Flow(akka.stream.javadsl.Flow) AuditEventSubscriberLoggingImpl(io.mantisrx.master.events.AuditEventSubscriberLoggingImpl) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) LifecycleEventPublisherImpl(io.mantisrx.master.events.LifecycleEventPublisherImpl) JobDiscoveryRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandler) WorkerEventSubscriberLoggingImpl(io.mantisrx.master.events.WorkerEventSubscriberLoggingImpl) BeforeClass(org.testng.annotations.BeforeClass)

Example 10 with Http

use of akka.http.javadsl.Http in project mantis by Netflix.

the class JobRouteTest method testJobSubmit.

@Test(dependsOnMethods = { "setupJobCluster" })
public void testJobSubmit() throws InterruptedException {
    final CountDownLatch latch = new CountDownLatch(1);
    final CompletionStage<HttpResponse> responseFuture = http.singleRequest(HttpRequest.POST(String.format("http://127.0.0.1:%d/api/submit", targetEndpointPort)).withEntity(HttpEntities.create(ContentTypes.APPLICATION_JSON, JobClusterPayloads.JOB_CLUSTER_SUBMIT)));
    responseFuture.thenCompose(r -> processRespFut(r, Optional.of(200))).whenComplete((msg, t) -> {
        String responseMessage = getResponseMessage(msg, t);
        logger.info("got response {}", responseMessage);
        assertEquals("sine-function-1", responseMessage);
        latch.countDown();
    });
    assertTrue(latch.await(10, TimeUnit.SECONDS));
}
Also used : JobStatusStreamRoute(io.mantisrx.master.api.akka.route.v1.JobStatusStreamRoute) TestHelpers(com.netflix.mantis.master.scheduler.TestHelpers) MantisJobDurationType(io.mantisrx.runtime.MantisJobDurationType) MantisJobState(io.mantisrx.runtime.MantisJobState) MasterDescription(io.mantisrx.server.core.master.MasterDescription) JobRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobRouteHandler) TypeReference(io.mantisrx.shaded.com.fasterxml.jackson.core.type.TypeReference) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) MantisJobStore(io.mantisrx.server.master.persistence.MantisJobStore) Test(org.testng.annotations.Test) MantisScheduler(io.mantisrx.server.master.scheduler.MantisScheduler) JobsRoute(io.mantisrx.master.api.akka.route.v1.JobsRoute) MantisStageMetadataWritable(io.mantisrx.server.master.store.MantisStageMetadataWritable) JobClustersManagerActor(io.mantisrx.master.JobClustersManagerActor) JobPayloads(io.mantisrx.master.api.akka.payloads.JobPayloads) ActorMaterializer(akka.stream.ActorMaterializer) ActorRef(akka.actor.ActorRef) MantisMasterRoute(io.mantisrx.master.api.akka.route.MantisMasterRoute) Duration(java.time.Duration) Map(java.util.Map) JobClusterProtoAdapter(io.mantisrx.master.api.akka.route.proto.JobClusterProtoAdapter) Assert.fail(org.junit.Assert.fail) LastSubmittedJobIdStreamRoute(io.mantisrx.master.api.akka.route.v1.LastSubmittedJobIdStreamRoute) StatusEventSubscriberLoggingImpl(io.mantisrx.master.events.StatusEventSubscriberLoggingImpl) ServerBinding(akka.http.javadsl.ServerBinding) HttpCharsets(akka.http.javadsl.model.HttpCharsets) JobStatusRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobStatusRouteHandler) WorkerEventSubscriberLoggingImpl(io.mantisrx.master.events.WorkerEventSubscriberLoggingImpl) Jackson(io.mantisrx.master.api.akka.route.Jackson) BeforeClass(org.testng.annotations.BeforeClass) AdminMasterRoute(io.mantisrx.master.api.akka.route.v1.AdminMasterRoute) JobDiscoveryRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandler) HttpMethods(akka.http.javadsl.model.HttpMethods) WorkerAssignments(io.mantisrx.server.core.WorkerAssignments) JobClusterRouteHandler(io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandler) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) AgentClusterOperations(io.mantisrx.master.vm.AgentClusterOperations) CompletionStage(java.util.concurrent.CompletionStage) NotUsed(akka.NotUsed) AgentClustersRoute(io.mantisrx.master.api.akka.route.v1.AgentClustersRoute) ActorSystem(akka.actor.ActorSystem) JobDiscoveryStreamRoute(io.mantisrx.master.api.akka.route.v1.JobDiscoveryStreamRoute) JobDiscoveryRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandlerAkkaImpl) Optional(java.util.Optional) Mockito.mock(org.mockito.Mockito.mock) MantisJobMetadataView(io.mantisrx.master.jobcluster.job.MantisJobMetadataView) MantisWorkerMetadataWritable(io.mantisrx.server.master.store.MantisWorkerMetadataWritable) Flow(akka.stream.javadsl.Flow) JobRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobRouteHandlerAkkaImpl) LeaderRedirectionFilter(io.mantisrx.server.master.LeaderRedirectionFilter) Matchers.anyString(org.mockito.Matchers.anyString) AuditEventSubscriberLoggingImpl(io.mantisrx.master.events.AuditEventSubscriberLoggingImpl) Observable(rx.Observable) JobClusterPayloads(io.mantisrx.master.api.akka.payloads.JobClusterPayloads) CompactJobInfo(io.mantisrx.server.master.http.api.CompactJobInfo) LifecycleEventPublisherImpl(io.mantisrx.master.events.LifecycleEventPublisherImpl) JobTestHelper(io.mantisrx.master.jobcluster.job.JobTestHelper) ByteString(akka.util.ByteString) HttpEntity(akka.http.javadsl.model.HttpEntity) NamedJobInfo(io.mantisrx.server.core.NamedJobInfo) LocalMasterMonitor(io.mantisrx.server.core.master.LocalMasterMonitor) LeadershipManagerLocalImpl(io.mantisrx.server.master.LeadershipManagerLocalImpl) JobClusterRouteHandlerAkkaImpl(io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandlerAkkaImpl) JobSchedulingInfo(io.mantisrx.server.core.JobSchedulingInfo) AfterClass(org.testng.annotations.AfterClass) Logger(org.slf4j.Logger) Assert.assertNotNull(org.junit.Assert.assertNotNull) Http(akka.http.javadsl.Http) HttpRequest(akka.http.javadsl.model.HttpRequest) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) ContentTypes(akka.http.javadsl.model.ContentTypes) HttpEntities(akka.http.javadsl.model.HttpEntities) HttpResponse(akka.http.javadsl.model.HttpResponse) FakeMantisScheduler(io.mantisrx.master.scheduler.FakeMantisScheduler) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) JobClusterManagerProto(io.mantisrx.master.jobcluster.proto.JobClusterManagerProto) ConnectHttp(akka.http.javadsl.ConnectHttp) MediaTypes(akka.http.javadsl.model.MediaTypes) JobClustersRoute(io.mantisrx.master.api.akka.route.v1.JobClustersRoute) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) LifecycleEventPublisher(io.mantisrx.master.events.LifecycleEventPublisher) HttpResponse(akka.http.javadsl.model.HttpResponse) Matchers.anyString(org.mockito.Matchers.anyString) ByteString(akka.util.ByteString) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.testng.annotations.Test)

Aggregations

Http (akka.http.javadsl.Http)17 ConnectHttp (akka.http.javadsl.ConnectHttp)16 ActorMaterializer (akka.stream.ActorMaterializer)15 Flow (akka.stream.javadsl.Flow)14 CountDownLatch (java.util.concurrent.CountDownLatch)14 BeforeClass (org.testng.annotations.BeforeClass)14 ActorRef (akka.actor.ActorRef)11 FakeMantisScheduler (io.mantisrx.master.scheduler.FakeMantisScheduler)11 MantisJobStore (io.mantisrx.server.master.persistence.MantisJobStore)11 MantisScheduler (io.mantisrx.server.master.scheduler.MantisScheduler)10 AuditEventSubscriberLoggingImpl (io.mantisrx.master.events.AuditEventSubscriberLoggingImpl)9 LifecycleEventPublisher (io.mantisrx.master.events.LifecycleEventPublisher)9 LifecycleEventPublisherImpl (io.mantisrx.master.events.LifecycleEventPublisherImpl)9 StatusEventSubscriberLoggingImpl (io.mantisrx.master.events.StatusEventSubscriberLoggingImpl)9 WorkerEventSubscriberLoggingImpl (io.mantisrx.master.events.WorkerEventSubscriberLoggingImpl)9 IOException (java.io.IOException)7 ServerBinding (akka.http.javadsl.ServerBinding)6 JobClusterRouteHandler (io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandler)6 JobClusterRouteHandlerAkkaImpl (io.mantisrx.master.api.akka.route.handlers.JobClusterRouteHandlerAkkaImpl)6 JobDiscoveryRouteHandler (io.mantisrx.master.api.akka.route.handlers.JobDiscoveryRouteHandler)6