示例#1
0
 private void registerElasticEnv() {
   listenerManager.startAllListeners();
   leaderElectionService.leaderElection();
   configService.persistJobConfiguration();
   serverService.persistServerOnline();
   serverService.clearJobStopedStatus();
   statisticsService.startProcessCountJob();
   shardingService.setReshardingFlag();
   monitorService.listen();
 }
示例#2
0
 /**
  * 恢复因服务器崩溃而停止的作业.
  *
  * <p>不会恢复手工设置停止运行的作业.
  */
 public void resumeCrashedJob() {
   serverService.persistServerOnline();
   executionService.clearRunningInfo(shardingService.getLocalHostShardingItems());
   if (serverService.isJobStopedManually()) {
     return;
   }
   try {
     scheduler.resumeAll();
   } catch (final SchedulerException ex) {
     throw new JobException(ex);
   }
 }