當前位置: 首頁>>代碼示例>>Java>>正文


Java CoordinatorRegistryCenter類代碼示例

本文整理匯總了Java中com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter的典型用法代碼示例。如果您正苦於以下問題:Java CoordinatorRegistryCenter類的具體用法?Java CoordinatorRegistryCenter怎麽用?Java CoordinatorRegistryCenter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CoordinatorRegistryCenter類屬於com.dangdang.ddframe.reg.base包,在下文中一共展示了CoordinatorRegistryCenter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getInstance

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
/**
   * 獲取全局配置實例
   * 
   * @param coordinatorRegistryCenter 注冊中心
   * @return 全局配置實例
   */
  public static GlobalConfigurationService getInstance(final CoordinatorRegistryCenter coordinatorRegistryCenter) {
if (null == coordinatorRegistryCenter) return null;

  	if (globalConfigClassPool.containsKey(coordinatorRegistryCenter)) {
  		return globalConfigClassPool.get(coordinatorRegistryCenter);
  	}
  	
  	synchronized(GlobalConfigurationService.class){
  		if (globalConfigClassPool.containsKey(coordinatorRegistryCenter)) {
      		return globalConfigClassPool.get(coordinatorRegistryCenter);
      	} else {
      		return new GlobalConfigurationService(coordinatorRegistryCenter);
      	}
  	}
  }
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:22,代碼來源:GlobalConfigurationService.java

示例2: getTriggerBeginInfo

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
private JobTriggerHistory getTriggerBeginInfo(final CoordinatorRegistryCenter registryCenter, String path) {
        path = path.substring(0, path.lastIndexOf("/"));
        JobTriggerHistory result = new JobTriggerHistory();
        setCommonItem(registryCenter, result, path);
        result.setShardingCount(Integer.parseInt(registryCenter.get(getFullPath("/", result.getJobName(), "/config", "/shardingTotalCount"))));
        result.setServerIp(registryCenter.get(getFullPath(path, "/serverIp")));
        String lastBeginTime = registryCenter.get(getFullPath(path, "/lastBeginTime"));
        result.setBeginTime(null == lastBeginTime ? null : new Timestamp(Long.parseLong(lastBeginTime)));
        String nextFireTime = registryCenter.get(getFullPath(path, "/nextFireTime"));
        result.setNextFireTime(null == nextFireTime ? null : new Timestamp(Long.parseLong(nextFireTime)));
        result.setStatus(ExecutionInfo.ExecutionStatus.RUNNING.getCode());
//        if (registryCenter.isExisted(getFullPath(path, "/completed"))) {
//            result.setStatus(getCompleteFlag(registryCenter, path).getCode());
//            String lastCompleteTime = registryCenter.get(getFullPath(path, "/lastCompleteTime"));
//            result.setCompleteTime(null == lastCompleteTime ? null : new Timestamp(Long.parseLong(lastCompleteTime)));
//        }
        return result;
    }
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:19,代碼來源:JobTriggerHistoryServiceImpl.java

示例3: getCompleteFlag

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
private ExecutionInfo.ExecutionStatus getCompleteFlag(final CoordinatorRegistryCenter registryCenter, final String path) {
    boolean completeFlag;
    String completedPath = getFullPath(path, "/completed");
    String completedValue = registryCenter.get(completedPath);
    if (Strings.isNullOrEmpty(completedValue)) {
        // 兼容老版本"/completed"無值的情況
        completeFlag = true;
    } else {
        completeFlag = Boolean.valueOf(completedValue);
    }
    if (completeFlag) {
        return ExecutionInfo.ExecutionStatus.COMPLETED;
    } else {
        return ExecutionInfo.ExecutionStatus.FAILED;
    }
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:17,代碼來源:JobTriggerHistoryServiceImpl.java

示例4: createCoordinatorRegistryCenter

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
/**
 * 創建注冊中心.
 *
 * @param connectString 注冊中心連接字符串
 * @param namespace 注冊中心命名空間
 * @param digest 注冊中心憑證
 * @return 注冊中心對象
 */
public static CoordinatorRegistryCenter createCoordinatorRegistryCenter(final String connectString, final String namespace, final Optional<String> digest) {
    Hasher hasher =  Hashing.md5().newHasher().putString(connectString, Charsets.UTF_8).putString(namespace, Charsets.UTF_8);
    if (digest.isPresent()) {
        hasher.putString(digest.get(), Charsets.UTF_8);
    }
    HashCode hashCode = hasher.hash();
    if (registryCenterMap.containsKey(hashCode)) {
        return registryCenterMap.get(hashCode);
    }
    ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(connectString, namespace);
    if (digest.isPresent()) {
        zkConfig.setDigest(digest.get());
    }
    CoordinatorRegistryCenter result = new ZookeeperRegistryCenter(zkConfig);
    result.init();
    registryCenterMap.putIfAbsent(hashCode, result);
    return result;
}
 
開發者ID:zhoujia123,項目名稱:ElasticJob,代碼行數:27,代碼來源:RegistryCenterFactory.java

示例5: JobScheduler

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public JobScheduler(final CoordinatorRegistryCenter regCenter, final JobConfiguration jobConfig, final ElasticJobListener... elasticJobListeners) {
    jobName = jobConfig.getJobName();
    this.regCenter = regCenter;
    List<ElasticJobListener> elasticJobListenerList = Arrays.asList(elasticJobListeners);
    setGuaranteeServiceForElasticJobListeners(regCenter, jobConfig, elasticJobListenerList);
    schedulerFacade = new SchedulerFacade(regCenter, jobConfig, elasticJobListenerList);
    jobFacade = new JobFacade(regCenter, jobConfig, elasticJobListenerList);
    jobDetail = JobBuilder.newJob(jobConfig.getJobClass()).withIdentity(jobName).build();
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:10,代碼來源:JobScheduler.java

示例6: setGuaranteeServiceForElasticJobListeners

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
private void setGuaranteeServiceForElasticJobListeners(final CoordinatorRegistryCenter regCenter, final JobConfiguration jobConfig, final List<ElasticJobListener> elasticJobListeners) {
    GuaranteeService guaranteeService = new GuaranteeService(regCenter, jobConfig);
    for (ElasticJobListener each : elasticJobListeners) {
        if (each instanceof AbstractDistributeOnceElasticJobListener) {
            ((AbstractDistributeOnceElasticJobListener) each).setGuaranteeService(guaranteeService);
        }
    }
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:9,代碼來源:JobScheduler.java

示例7: ListenerManager

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public ListenerManager(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration, final List<ElasticJobListener> elasticJobListeners) {
    electionListenerManager = new ElectionListenerManager(coordinatorRegistryCenter, jobConfiguration);
    shardingListenerManager = new ShardingListenerManager(coordinatorRegistryCenter, jobConfiguration);
    executionListenerManager = new ExecutionListenerManager(coordinatorRegistryCenter, jobConfiguration);
    failoverListenerManager = new FailoverListenerManager(coordinatorRegistryCenter, jobConfiguration);
    jobOperationListenerManager = new JobOperationListenerManager(coordinatorRegistryCenter, jobConfiguration);
    configurationListenerManager = new ConfigurationListenerManager(coordinatorRegistryCenter, jobConfiguration);
    guaranteeListenerManager = new GuaranteeListenerManager(coordinatorRegistryCenter, jobConfiguration, elasticJobListeners);
    globalConfigListenerManager = new GlobalConfigListenerManager(coordinatorRegistryCenter);
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:11,代碼來源:ListenerManager.java

示例8: JobFacade

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public JobFacade(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration, final List<ElasticJobListener> elasticJobListeners) {
    configService = new ConfigurationService(coordinatorRegistryCenter, jobConfiguration);
    globalConfigService = GlobalConfigurationService.getInstance(coordinatorRegistryCenter);
    shardingService = new ShardingService(coordinatorRegistryCenter, jobConfiguration);
    serverService = new ServerService(coordinatorRegistryCenter, jobConfiguration);
    executionContextService = new ExecutionContextService(coordinatorRegistryCenter, jobConfiguration);
    executionService = new ExecutionService(coordinatorRegistryCenter, jobConfiguration);
    failoverService = new FailoverService(coordinatorRegistryCenter, jobConfiguration);
    offsetService = new OffsetService(coordinatorRegistryCenter, jobConfiguration);
    this.elasticJobListeners = elasticJobListeners;
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:12,代碼來源:JobFacade.java

示例9: SchedulerFacade

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public SchedulerFacade(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration, final List<ElasticJobListener> elasticJobListeners) {
    configService = new ConfigurationService(coordinatorRegistryCenter, jobConfiguration);
    leaderElectionService = new LeaderElectionService(coordinatorRegistryCenter, jobConfiguration);
    serverService = new ServerService(coordinatorRegistryCenter, jobConfiguration);
    shardingService = new ShardingService(coordinatorRegistryCenter, jobConfiguration);
    executionService = new ExecutionService(coordinatorRegistryCenter, jobConfiguration);
    statisticsService = new StatisticsService(coordinatorRegistryCenter, jobConfiguration);
    monitorService = new MonitorService(coordinatorRegistryCenter, jobConfiguration);
    listenerManager = new ListenerManager(coordinatorRegistryCenter, jobConfiguration, elasticJobListeners);
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:11,代碼來源:SchedulerFacade.java

示例10: ElectionListenerManager

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public ElectionListenerManager(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration) {
    super(coordinatorRegistryCenter, jobConfiguration);
    leaderElectionService = new LeaderElectionService(coordinatorRegistryCenter, jobConfiguration);
    serverService = new ServerService(coordinatorRegistryCenter, jobConfiguration);
    electionNode = new ElectionNode(jobConfiguration.getJobName());
    serverNode = new ServerNode(jobConfiguration.getJobName());
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:8,代碼來源:ElectionListenerManager.java

示例11: ExecutionService

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public ExecutionService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration) {
    this.jobConfiguration = jobConfiguration;
    jobNodeStorage = new JobNodeStorage(coordinatorRegistryCenter, jobConfiguration);
    configService = new ConfigurationService(coordinatorRegistryCenter, jobConfiguration);
    serverService = new ServerService(coordinatorRegistryCenter, jobConfiguration);
    leaderElectionService = new LeaderElectionService(coordinatorRegistryCenter, jobConfiguration);
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:8,代碼來源:ExecutionService.java

示例12: JobOperationListenerManager

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public JobOperationListenerManager(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration) {
    super(coordinatorRegistryCenter, jobConfiguration);
    jobName = jobConfiguration.getJobName();
    serverNode = new ServerNode(jobName);
    leaderElectionService = new LeaderElectionService(coordinatorRegistryCenter, jobConfiguration);
    serverService = new ServerService(coordinatorRegistryCenter, jobConfiguration);
    shardingService = new ShardingService(coordinatorRegistryCenter, jobConfiguration);
    executionService = new ExecutionService(coordinatorRegistryCenter, jobConfiguration);
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:10,代碼來源:JobOperationListenerManager.java

示例13: FailoverListenerManager

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public FailoverListenerManager(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration) {
    super(coordinatorRegistryCenter, jobConfiguration);
    configService = new ConfigurationService(coordinatorRegistryCenter, jobConfiguration);
    executionService = new ExecutionService(coordinatorRegistryCenter, jobConfiguration);
    shardingService = new ShardingService(coordinatorRegistryCenter, jobConfiguration);
    failoverService = new FailoverService(coordinatorRegistryCenter, jobConfiguration);
    configNode = new ConfigurationNode(jobConfiguration.getJobName());
    executionNode = new ExecutionNode(jobConfiguration.getJobName());
    failoverNode = new FailoverNode(jobConfiguration.getJobName());
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:11,代碼來源:FailoverListenerManager.java

示例14: ShardingListenerManager

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public ShardingListenerManager(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration) {
    super(coordinatorRegistryCenter, jobConfiguration);
    shardingService = new ShardingService(coordinatorRegistryCenter, jobConfiguration);
    executionService = new ExecutionService(coordinatorRegistryCenter, jobConfiguration);
    configurationNode = new ConfigurationNode(jobConfiguration.getJobName());
    serverNode = new ServerNode(jobConfiguration.getJobName());
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:8,代碼來源:ShardingListenerManager.java

示例15: ShardingService

import com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter; //導入依賴的package包/類
public ShardingService(final CoordinatorRegistryCenter coordinatorRegistryCenter, final JobConfiguration jobConfiguration) {
    jobName = jobConfiguration.getJobName();
    jobNodeStorage = new JobNodeStorage(coordinatorRegistryCenter, jobConfiguration);
    leaderElectionService = new LeaderElectionService(coordinatorRegistryCenter, jobConfiguration);
    configService = new ConfigurationService(coordinatorRegistryCenter, jobConfiguration);
    serverService = new ServerService(coordinatorRegistryCenter, jobConfiguration);
    executionService = new ExecutionService(coordinatorRegistryCenter, jobConfiguration);
    globalConfigService = GlobalConfigurationService.getInstance(coordinatorRegistryCenter);
    jobNodePath = new JobNodePath(jobConfiguration.getJobName());
}
 
開發者ID:artoderk,項目名稱:elastic-jobx,代碼行數:11,代碼來源:ShardingService.java


注:本文中的com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。