Search in sources :

Example 1 with JobScheduler

use of com.dangdang.ddframe.job.api.JobScheduler in project sharding-jdbc by dangdangdotcom.

the class AbstractBestEffortsDeliveryJobFactory method init.

/**
     * 初始化作业.
     */
public final void init() {
    @SuppressWarnings("unchecked") T bedJobConfig = (T) transactionConfig.getBestEffortsDeliveryJobConfiguration().get();
    CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(createZookeeperConfiguration(bedJobConfig));
    regCenter.init();
    JobScheduler jobScheduler = new JobScheduler(regCenter, createBedJobConfiguration(bedJobConfig));
    jobScheduler.setField("transactionConfig", transactionConfig);
    jobScheduler.setField("transactionLogStorage", TransactionLogStorageFactory.createTransactionLogStorage(transactionConfig.buildTransactionLogDataSource()));
    jobScheduler.init();
}
Also used : JobScheduler(com.dangdang.ddframe.job.api.JobScheduler) ZookeeperRegistryCenter(com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter) CoordinatorRegistryCenter(com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter)

Example 2 with JobScheduler

use of com.dangdang.ddframe.job.api.JobScheduler in project sharding-jdbc by dangdangdotcom.

the class BestEffortsDeliveryJobFactory method init.

/**
     * 初始化作业.
     */
public void init() {
    CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(createZookeeperConfiguration(bedConfig));
    regCenter.init();
    JobScheduler jobScheduler = new JobScheduler(regCenter, createBedJobConfiguration(bedConfig));
    jobScheduler.setField("bedConfig", bedConfig);
    jobScheduler.setField("transactionLogStorage", TransactionLogStorageFactory.createTransactionLogStorage(new RdbTransactionLogDataSource(bedConfig.getDefaultTransactionLogDataSource())));
    jobScheduler.init();
}
Also used : JobScheduler(com.dangdang.ddframe.job.api.JobScheduler) RdbTransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource) ZookeeperRegistryCenter(com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter) CoordinatorRegistryCenter(com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter)

Aggregations

JobScheduler (com.dangdang.ddframe.job.api.JobScheduler)2 CoordinatorRegistryCenter (com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter)2 ZookeeperRegistryCenter (com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter)2 RdbTransactionLogDataSource (com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource)1