Search in sources :

Example 1 with ActorScheduler

use of io.zeebe.util.sched.ActorScheduler in project zeebe by zeebe-io.

the class BufferingServerTransportService method start.

@Override
public void start(ServiceStartContext serviceContext) {
    final ActorScheduler scheduler = serviceContext.getScheduler();
    final Dispatcher receiveBuffer = receiveBufferInjector.getValue();
    final Dispatcher sendBuffer = sendBufferInjector.getValue();
    serverTransport = Transports.newServerTransport().name(readableName).bindAddress(bindAddress).sendBuffer(sendBuffer).scheduler(scheduler).buildBuffering(receiveBuffer);
    LOG.info("Bound {} to {}", readableName, bindAddress);
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) Dispatcher(io.zeebe.dispatcher.Dispatcher)

Example 2 with ActorScheduler

use of io.zeebe.util.sched.ActorScheduler in project zeebe by zeebe-io.

the class ControlMessageHandlerManagerService method start.

@Override
public void start(ServiceStartContext context) {
    final Dispatcher controlMessageBuffer = controlMessageBufferInjector.getValue();
    final ServerTransport transport = transportInjector.getValue();
    final ActorScheduler actorScheduler = context.getScheduler();
    final TaskSubscriptionManager taskSubscriptionManager = taskSubscriptionManagerInjector.getValue();
    final TopicSubscriptionService topicSubscriptionService = topicSubscriptionServiceInjector.getValue();
    final SystemPartitionManager systemPartitionManager = systemPartitionManagerInjector.getValue();
    final ServerOutput output = transport.getOutput();
    final List<ControlMessageHandler> controlMessageHandlers = Arrays.asList(new AddTaskSubscriptionHandler(output, taskSubscriptionManager), new IncreaseTaskSubscriptionCreditsHandler(output, taskSubscriptionManager), new RemoveTaskSubscriptionHandler(output, taskSubscriptionManager), new RemoveTopicSubscriptionHandler(output, topicSubscriptionService), new RequestTopologyHandler(output, clusterManagerInjector.getValue()), new RequestPartitionsMessageHandler(output, systemPartitionManager));
    service = new ControlMessageHandlerManager(transport.getOutput(), controlMessageBuffer, controlMessageRequestTimeoutInMillis, actorScheduler, controlMessageHandlers);
    context.async(service.openAsync());
}
Also used : ServerOutput(io.zeebe.transport.ServerOutput) ServerTransport(io.zeebe.transport.ServerTransport) TopicSubscriptionService(io.zeebe.broker.event.processor.TopicSubscriptionService) RemoveTopicSubscriptionHandler(io.zeebe.broker.event.handler.RemoveTopicSubscriptionHandler) SystemPartitionManager(io.zeebe.broker.system.log.SystemPartitionManager) Dispatcher(io.zeebe.dispatcher.Dispatcher) TaskSubscriptionManager(io.zeebe.broker.task.TaskSubscriptionManager) RequestPartitionsMessageHandler(io.zeebe.broker.system.log.RequestPartitionsMessageHandler) RequestTopologyHandler(io.zeebe.broker.clustering.handler.RequestTopologyHandler) ActorScheduler(io.zeebe.util.sched.ActorScheduler)

Example 3 with ActorScheduler

use of io.zeebe.util.sched.ActorScheduler in project zeebe by zeebe-io.

the class MetricsFileWriterService method start.

@Override
public void start(ServiceStartContext startContext) {
    final ActorScheduler scheduler = startContext.getScheduler();
    final MetricsManager metricsManager = startContext.getScheduler().getMetricsManager();
    final String metricsFileName = new File(cfg.getDirectory(), cfg.metricsFile).getAbsolutePath();
    metricsFileWriter = new MetricsFileWriter(Duration.ofSeconds(cfg.reportingInterval), metricsFileName, metricsManager);
    startContext.async(scheduler.submitActor(metricsFileWriter, SchedulingHints.isIoBound(0)));
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) MetricsManager(io.zeebe.util.metrics.MetricsManager) File(java.io.File)

Example 4 with ActorScheduler

use of io.zeebe.util.sched.ActorScheduler in project zeebe by zeebe-io.

the class TaskSubscriptionManagerService method start.

@Override
public void start(ServiceStartContext startContext) {
    final ServerTransport clientApiTransport = transportInjector.getValue();
    final ActorScheduler actorScheduler = startContext.getScheduler();
    service = new TaskSubscriptionManager(startContext, clientApiTransport);
    actorScheduler.submitActor(service);
    final ActorFuture<Void> transportRegistration = clientApiTransport.registerChannelListener(service);
    startContext.async(transportRegistration);
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) ServerTransport(io.zeebe.transport.ServerTransport)

Example 5 with ActorScheduler

use of io.zeebe.util.sched.ActorScheduler in project zeebe by zeebe-io.

the class ClusterManagerContextService method start.

@Override
public void start(ServiceStartContext startContext) {
    final ClientTransport clientTransport = managementClientInjector.getValue();
    final BufferingServerTransport serverTransport = managementApiTransportInjector.getValue();
    final ActorScheduler actorScheduler = startContext.getScheduler();
    final LogStreamsManager logStreamsManager = logStreamsManagerInjector.getValue();
    final WorkflowRequestMessageHandler workflowRequestMessageHandler = workflowRequestMessageHandlerInjector.getValue();
    context = new ClusterManagerContext();
    context.setGossip(gossipInjector.getValue());
    context.setActorScheduler(actorScheduler);
    context.setManagementClient(clientTransport);
    context.setReplicationClient(replicationClientInjector.getValue());
    context.setServerTransport(serverTransport);
    context.setMemberListService(memberListServiceInjector.getValue());
    context.setLogStreamsManager(logStreamsManager);
    context.setWorkflowRequestMessageHandler(workflowRequestMessageHandler);
}
Also used : ActorScheduler(io.zeebe.util.sched.ActorScheduler) WorkflowRequestMessageHandler(io.zeebe.broker.system.deployment.handler.WorkflowRequestMessageHandler) ClusterManagerContext(io.zeebe.broker.clustering.management.ClusterManagerContext) ClientTransport(io.zeebe.transport.ClientTransport) LogStreamsManager(io.zeebe.broker.logstreams.LogStreamsManager) BufferingServerTransport(io.zeebe.transport.BufferingServerTransport)

Aggregations

ActorScheduler (io.zeebe.util.sched.ActorScheduler)8 Dispatcher (io.zeebe.dispatcher.Dispatcher)4 ServerTransport (io.zeebe.transport.ServerTransport)2 RequestTopologyHandler (io.zeebe.broker.clustering.handler.RequestTopologyHandler)1 ClusterManagerContext (io.zeebe.broker.clustering.management.ClusterManagerContext)1 RemoveTopicSubscriptionHandler (io.zeebe.broker.event.handler.RemoveTopicSubscriptionHandler)1 TopicSubscriptionService (io.zeebe.broker.event.processor.TopicSubscriptionService)1 LogStreamsManager (io.zeebe.broker.logstreams.LogStreamsManager)1 WorkflowRequestMessageHandler (io.zeebe.broker.system.deployment.handler.WorkflowRequestMessageHandler)1 RequestPartitionsMessageHandler (io.zeebe.broker.system.log.RequestPartitionsMessageHandler)1 SystemPartitionManager (io.zeebe.broker.system.log.SystemPartitionManager)1 TaskSubscriptionManager (io.zeebe.broker.task.TaskSubscriptionManager)1 LogStream (io.zeebe.logstreams.log.LogStream)1 SnapshotStorage (io.zeebe.logstreams.spi.SnapshotStorage)1 BufferingServerTransport (io.zeebe.transport.BufferingServerTransport)1 ClientTransport (io.zeebe.transport.ClientTransport)1 ServerOutput (io.zeebe.transport.ServerOutput)1 MetricsManager (io.zeebe.util.metrics.MetricsManager)1 File (java.io.File)1