Search in sources :

Example 1 with RdbTransactionLogDataSource

use of com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource in project sharding-jdbc by dangdangdotcom.

the class TransactionLogStorageFactoryTest method assertCreateRdbTransactionLogStorageFactory.

@Test
public void assertCreateRdbTransactionLogStorageFactory() {
    DataSource dataSource = mock(DataSource.class);
    TransactionLogDataSource transactionLogDataSource = new RdbTransactionLogDataSource(dataSource);
    assertThat(TransactionLogStorageFactory.createTransactionLogStorage(transactionLogDataSource), instanceOf(TransactionLogStorage.class));
}
Also used : RdbTransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource) MemoryTransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.MemoryTransactionLogDataSource) TransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.TransactionLogDataSource) RdbTransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource) MemoryTransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.MemoryTransactionLogDataSource) DataSource(javax.sql.DataSource) TransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.TransactionLogDataSource) RdbTransactionLogDataSource(com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource) Test(org.junit.Test)

Example 2 with RdbTransactionLogDataSource

use of com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource 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

RdbTransactionLogDataSource (com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.RdbTransactionLogDataSource)2 JobScheduler (com.dangdang.ddframe.job.api.JobScheduler)1 TransactionLogDataSource (com.dangdang.ddframe.rdb.transaction.soft.datasource.TransactionLogDataSource)1 MemoryTransactionLogDataSource (com.dangdang.ddframe.rdb.transaction.soft.datasource.impl.MemoryTransactionLogDataSource)1 CoordinatorRegistryCenter (com.dangdang.ddframe.reg.base.CoordinatorRegistryCenter)1 ZookeeperRegistryCenter (com.dangdang.ddframe.reg.zookeeper.ZookeeperRegistryCenter)1 DataSource (javax.sql.DataSource)1 Test (org.junit.Test)1