当前位置: 首页>>代码示例>>Java>>正文


Java IgniteConfiguration.getTransactionConfiguration方法代码示例

本文整理汇总了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();
        }
    });
}
 
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:GridPartitionedCacheJtaFactorySelfTest.java

示例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();
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:GridCacheUtils.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:41,代码来源:GridCacheEmptyEntriesAbstractSelfTest.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:GridCacheTransformEventSelfTest.java

示例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;
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:GridCachePartitionedTxTimeoutSelfTest.java


注:本文中的org.apache.ignite.configuration.IgniteConfiguration.getTransactionConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。