Search in sources :

Example 1 with EngineJobCacheService

use of com.dtstack.taier.scheduler.service.EngineJobCacheService in project Taier by DTStack.

the class ShardCache method getShardManager.

private ShardManager getShardManager(String jobId) {
    EngineJobCacheService engineJobCacheService = applicationContext.getBean(EngineJobCacheService.class);
    ScheduleEngineJobCache engineJobCache = engineJobCacheService.getByJobId(jobId);
    if (engineJobCache == null) {
        return null;
    }
    return jobResourceShardManager.computeIfAbsent(engineJobCache.getJobResource(), jr -> {
        ShardManager shardManager = new ShardManager(engineJobCache.getJobResource());
        JobStatusDealer jobStatusDealer = new JobStatusDealer();
        jobStatusDealer.setJobResource(engineJobCache.getJobResource());
        jobStatusDealer.setShardManager(shardManager);
        jobStatusDealer.setShardCache(this);
        jobStatusDealer.setApplicationContext(applicationContext);
        jobStatusDealer.start();
        return shardManager;
    });
}
Also used : EngineJobCacheService(com.dtstack.taier.scheduler.service.EngineJobCacheService) JobStatusDealer(com.dtstack.taier.scheduler.jobdealer.JobStatusDealer) ScheduleEngineJobCache(com.dtstack.taier.dao.domain.ScheduleEngineJobCache)

Aggregations

ScheduleEngineJobCache (com.dtstack.taier.dao.domain.ScheduleEngineJobCache)1 JobStatusDealer (com.dtstack.taier.scheduler.jobdealer.JobStatusDealer)1 EngineJobCacheService (com.dtstack.taier.scheduler.service.EngineJobCacheService)1