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


Java CacheAtomicityMode.TRANSACTIONAL属性代码示例

本文整理汇总了Java中org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL属性的典型用法代码示例。如果您正苦于以下问题:Java CacheAtomicityMode.TRANSACTIONAL属性的具体用法?Java CacheAtomicityMode.TRANSACTIONAL怎么用?Java CacheAtomicityMode.TRANSACTIONAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.ignite.cache.CacheAtomicityMode的用法示例。


在下文中一共展示了CacheAtomicityMode.TRANSACTIONAL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

/**
 * Run benchmarks.
 *
 * @param args Arguments.
 * @throws Exception If failed.
 */
public static void main(String[] args) throws Exception {
    final String simpleClsName = JmhCacheLocksBenchmark.class.getSimpleName();
    final int threads = 4;
    final boolean client = true;
    final CacheAtomicityMode atomicityMode = CacheAtomicityMode.TRANSACTIONAL;
    final CacheWriteSynchronizationMode writeSyncMode = CacheWriteSynchronizationMode.FULL_SYNC;

    final String output = simpleClsName +
        "-" + threads + "-threads" +
        "-" + (client ? "client" : "data") +
        "-" + atomicityMode +
        "-" + writeSyncMode;

    final Options opt = new OptionsBuilder()
        .threads(threads)
        .include(simpleClsName)
        .output(output + ".jmh.log")
        .jvmArgs(
            "-Xms1g",
            "-Xmx1g",
            "-XX:+UnlockCommercialFeatures",
            JmhIdeBenchmarkRunner.createProperty(PROP_ATOMICITY_MODE, atomicityMode),
            JmhIdeBenchmarkRunner.createProperty(PROP_WRITE_SYNC_MODE, writeSyncMode),
            JmhIdeBenchmarkRunner.createProperty(PROP_DATA_NODES, 4),
            JmhIdeBenchmarkRunner.createProperty(PROP_CLIENT_MODE, client)).build();

    new Runner(opt).run();
}
 
开发者ID:apache,项目名称:ignite,代码行数:34,代码来源:JmhCacheLocksBenchmark.java

示例2: checkConnectionLeak

/**
 * @param atomicityMode Atomicity mode.
 * @param txConcurrency Transaction concurrency.
 * @param txIsolation Transaction isolation.
 *
 * @throws Exception If failed.
 */
private void checkConnectionLeak(
        CacheAtomicityMode atomicityMode,
        TransactionConcurrency txConcurrency,
        TransactionIsolation txIsolation
) throws Exception {
    CacheConfiguration<Integer, Integer> cacheCfg = new CacheConfiguration<>();

    cacheCfg.setName(CACHE_NAME);
    cacheCfg.setCacheMode(CacheMode.PARTITIONED);
    cacheCfg.setAtomicityMode(atomicityMode);
    cacheCfg.setCacheStoreFactory(new TestStoreFactory());
    cacheCfg.setReadThrough(true);
    cacheCfg.setWriteThrough(false);
    cacheCfg.setLoadPreviousValue(true);

    Ignite ignite = ignite(CLIENT_NODE);
    IgniteCache<Integer, Integer> cache = ignite.createCache(cacheCfg);

    try {
        assertEquals(0, cache.size());

        if (atomicityMode == CacheAtomicityMode.TRANSACTIONAL) {
            try (Transaction tx = ignite.transactions().txStart(txConcurrency, txIsolation)) {
                cacheOp(cache);

                tx.commit();
            }
        }
        else {
            cacheOp(cache);
        }

        assertTrue("Session was leak on nodes: " + TestStore.sessions, TestStore.sessions.isEmpty());
    }
    finally {
        cache.destroy();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:45,代码来源:CacheConnectionLeakStoreTxTest.java

示例3: atomicityMode

/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
    return CacheAtomicityMode.TRANSACTIONAL;
}
 
开发者ID:apache,项目名称:ignite,代码行数:4,代码来源:GridCacheClientModesTcpClientDiscoveryAbstractTest.java

示例4: H2DynamicIndexingComplexServerTransactionalPartitionedNoBackupsTest

/**
 * Constructor.
 */
public H2DynamicIndexingComplexServerTransactionalPartitionedNoBackupsTest() {
    super(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL, 0, SRV_IDX);
}
 
开发者ID:apache,项目名称:ignite,代码行数:6,代码来源:H2DynamicIndexingComplexServerTransactionalPartitionedNoBackupsTest.java

示例5: H2DynamicIndexingComplexServerTransactionalReplicatedTest

/**
 * Constructor.
 */
public H2DynamicIndexingComplexServerTransactionalReplicatedTest() {
    super(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL, 1, SRV_IDX);
}
 
开发者ID:apache,项目名称:ignite,代码行数:6,代码来源:H2DynamicIndexingComplexServerTransactionalReplicatedTest.java

示例6: DynamicIndexReplicatedTransactionalConcurrentSelfTest

/**
 * Constructor.
 */
public DynamicIndexReplicatedTransactionalConcurrentSelfTest() {
    super(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL);
}
 
开发者ID:apache,项目名称:ignite,代码行数:6,代码来源:DynamicIndexReplicatedTransactionalConcurrentSelfTest.java

示例7: atomicityMode

/**
 * @return Atomicity mode.
 */
protected CacheAtomicityMode atomicityMode() {
    return CacheAtomicityMode.TRANSACTIONAL;
}
 
开发者ID:apache,项目名称:ignite,代码行数:6,代码来源:GridCachePartitionedReloadAllAbstractSelfTest.java

示例8: atomicityMode

/**
 * @return Cache atomicity mode.
 */
protected CacheAtomicityMode atomicityMode(){
    return CacheAtomicityMode.TRANSACTIONAL;
}
 
开发者ID:apache,项目名称:ignite,代码行数:6,代码来源:IgniteCacheAbstractStopBusySelfTest.java

示例9: atomicMode

/**
 * @return Atomicity mode for a cache.
 */
protected CacheAtomicityMode atomicMode() {
    return CacheAtomicityMode.TRANSACTIONAL;
}
 
开发者ID:apache,项目名称:ignite,代码行数:6,代码来源:GridCacheContinuousQueryReplicatedTxOneNodeTest.java


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