本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.getTransactionConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.getTransactionConfiguration方法的具体用法?Java IgniteConfiguration.getTransactionConfiguration怎么用?Java IgniteConfiguration.getTransactionConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.getTransactionConfiguration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureJta
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void configureJta(IgniteConfiguration cfg) {
TransactionConfiguration txCfg = cfg.getTransactionConfiguration();
txCfg.setTxManagerFactory(new Factory<TransactionManager>() {
private static final long serialVersionUID = 0L;
@Override public TransactionManager create() {
return jotm.getTransactionManager();
}
});
}
示例2: transactionConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @return default TX configuration if system cache is used or current grid TX config otherwise.
*/
public static TransactionConfiguration transactionConfiguration(final @Nullable GridCacheContext sysCacheCtx,
final IgniteConfiguration cfg) {
return sysCacheCtx != null && sysCacheCtx.systemTx()
? DEFAULT_TX_CFG
: cfg.getTransactionConfiguration();
}
示例3: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TransactionConfiguration txCfg = c.getTransactionConfiguration();
txCfg.setDefaultTxConcurrency(txConcurrency);
txCfg.setDefaultTxIsolation(txIsolation);
txCfg.setTxSerializableEnabled(true);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(cacheMode());
cc.setAtomicityMode(TRANSACTIONAL);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cc.setEvictionPolicy(plc);
cc.setOnheapCacheEnabled(true);
if (testStore != null) {
cc.setCacheStoreFactory(singletonFactory(testStore));
cc.setReadThrough(true);
cc.setWriteThrough(true);
cc.setLoadPreviousValue(true);
}
else
cc.setCacheStoreFactory(null);
c.setCacheConfiguration(cc);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
return c;
}
示例4: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
TransactionConfiguration tCfg = cfg.getTransactionConfiguration();
tCfg.setDefaultTxConcurrency(txConcurrency);
tCfg.setDefaultTxIsolation(txIsolation);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName(CACHE_NAME);
ccfg.setCacheMode(cacheMode);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
if (cacheMode == PARTITIONED)
ccfg.setBackups(BACKUP_CNT);
cfg.setDiscoverySpi(discoSpi);
cfg.setCacheConfiguration(ccfg);
cfg.setLocalHost("127.0.0.1");
cfg.setIncludeEventTypes(EVT_CACHE_OBJECT_READ);
return cfg;
}
示例5: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TransactionConfiguration txCfg = c.getTransactionConfiguration();
txCfg.setTxSerializableEnabled(true);
txCfg.setDefaultTxTimeout(TIMEOUT);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(ipFinder);
c.setDiscoverySpi(spi);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(PARTITIONED);
cc.setBackups(1);
cc.setAtomicityMode(TRANSACTIONAL);
//cacheCfg.setPreloadMode(NONE);
c.setCacheConfiguration(cc);
return c;
}