use of io.mantisrx.server.master.persistence.SimpleCachedFileStorageProvider in project mantis by Netflix.
the class AgentClustersRouteTest method setup.
@BeforeClass
public void setup() throws InterruptedException {
TestHelpers.setupMasterConfig();
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 AgentClustersRoute agentClusterV2Route = new AgentClustersRoute(new AgentClusterOperationsImpl(storageProvider, new JobMessageRouterImpl(jobClustersManagerActor), fakeScheduler, lifecycleEventPublisher, "cluster"));
final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = agentClusterV2Route.createRoute(Function.identity()).flow(system, materializer);
logger.info("test server starting on port {}", serverPort);
latch.countDown();
binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("localhost", serverPort), materializer);
} catch (Exception e) {
logger.info("caught exception", e);
latch.countDown();
e.printStackTrace();
}
});
t.setDaemon(true);
t.start();
latch.await();
}
use of io.mantisrx.server.master.persistence.SimpleCachedFileStorageProvider in project mantis by Netflix.
the class JobClusterRouteTest method setup.
@BeforeClass
public static void setup() throws Exception {
TestHelpers.setupMasterConfig();
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());
ActorRef jobClustersManagerActor = system.actorOf(JobClustersManagerActor.props(new MantisJobStore(new SimpleCachedFileStorageProvider(true)), lifecycleEventPublisher), "jobClustersManager");
MantisScheduler fakeScheduler = new FakeMantisScheduler(jobClustersManagerActor);
jobClustersManagerActor.tell(new JobClusterManagerProto.JobClustersManagerInitialize(fakeScheduler, false), ActorRef.noSender());
final JobClusterRouteHandler jobClusterRouteHandler = new JobClusterRouteHandlerAkkaImpl(jobClustersManagerActor);
final JobRouteHandler jobRouteHandler = new JobRouteHandlerAkkaImpl(jobClustersManagerActor);
final JobClusterRoute app = new JobClusterRoute(jobClusterRouteHandler, jobRouteHandler, system);
final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = app.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();
}
use of io.mantisrx.server.master.persistence.SimpleCachedFileStorageProvider 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();
}
use of io.mantisrx.server.master.persistence.SimpleCachedFileStorageProvider in project mantis by Netflix.
the class JobClustersRouteTest method setup.
@BeforeClass
public void setup() throws Exception {
TestHelpers.setupMasterConfig();
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());
ActorRef jobClustersManagerActor = system.actorOf(JobClustersManagerActor.props(new MantisJobStore(new SimpleCachedFileStorageProvider(true)), lifecycleEventPublisher), "jobClustersManager");
MantisScheduler fakeScheduler = new FakeMantisScheduler(jobClustersManagerActor);
jobClustersManagerActor.tell(new JobClusterManagerProto.JobClustersManagerInitialize(fakeScheduler, false), ActorRef.noSender());
final JobClusterRouteHandler jobClusterRouteHandler = new JobClusterRouteHandlerAkkaImpl(jobClustersManagerActor);
final JobClustersRoute app = new JobClustersRoute(jobClusterRouteHandler, system);
final Flow<HttpRequest, HttpResponse, NotUsed> routeFlow = app.createRoute(Function.identity()).flow(system, materializer);
logger.info("starting test server on port {}", SERVER_PORT);
latch.countDown();
binding = http.bindAndHandle(routeFlow, ConnectHttp.toHost("localhost", SERVER_PORT), materializer);
} catch (Exception e) {
logger.info("caught exception", e);
latch.countDown();
e.printStackTrace();
}
});
t.setDaemon(true);
t.start();
latch.await();
}
Aggregations