Search in sources :

Example 1 with JobMetricsPublisher

use of com.hazelcast.jet.impl.metrics.JobMetricsPublisher in project hazelcast by hazelcast.

the class JetServiceBackend method init.

// ManagedService
@Override
public void init(NodeEngine engine, Properties hzProperties) {
    this.nodeEngine = (NodeEngineImpl) engine;
    this.jet = new JetInstanceImpl(nodeEngine.getNode().hazelcastInstance, jetConfig);
    jobRepository = new JobRepository(engine.getHazelcastInstance());
    taskletExecutionService = new TaskletExecutionService(nodeEngine, jetConfig.getCooperativeThreadCount(), nodeEngine.getProperties());
    jobCoordinationService = createJobCoordinationService();
    jobClassLoaderService = new JobClassLoaderService(nodeEngine, jobRepository);
    jobExecutionService = new JobExecutionService(nodeEngine, taskletExecutionService, jobClassLoaderService);
    MetricsService metricsService = nodeEngine.getService(MetricsService.SERVICE_NAME);
    metricsService.registerPublisher(nodeEngine -> new JobMetricsPublisher(jobExecutionService, nodeEngine.getLocalMember()));
    nodeEngine.getMetricsRegistry().registerDynamicMetricsProvider(jobExecutionService);
    networking = new Networking(engine, jobExecutionService, jetConfig.getFlowControlPeriodMs());
    ClientEngine clientEngine = engine.getService(ClientEngineImpl.SERVICE_NAME);
    ClientExceptionFactory clientExceptionFactory = clientEngine.getExceptionFactory();
    if (clientExceptionFactory != null) {
        ExceptionUtil.registerJetExceptions(clientExceptionFactory);
    } else {
        logger.fine("Jet exceptions are not registered to the ClientExceptionFactory" + " since the ClientExceptionFactory is not accessible.");
    }
    logger.info("Setting number of cooperative threads and default parallelism to " + jetConfig.getCooperativeThreadCount());
}
Also used : JobMetricsPublisher(com.hazelcast.jet.impl.metrics.JobMetricsPublisher) ClientEngine(com.hazelcast.client.impl.ClientEngine) TaskletExecutionService(com.hazelcast.jet.impl.execution.TaskletExecutionService) MetricsService(com.hazelcast.internal.metrics.impl.MetricsService) ClientExceptionFactory(com.hazelcast.client.impl.protocol.ClientExceptionFactory)

Aggregations

ClientEngine (com.hazelcast.client.impl.ClientEngine)1 ClientExceptionFactory (com.hazelcast.client.impl.protocol.ClientExceptionFactory)1 MetricsService (com.hazelcast.internal.metrics.impl.MetricsService)1 TaskletExecutionService (com.hazelcast.jet.impl.execution.TaskletExecutionService)1 JobMetricsPublisher (com.hazelcast.jet.impl.metrics.JobMetricsPublisher)1