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


Java CacheConfiguration.setName方法代码示例

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


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

示例1: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param name Cache name.
 * @param clsK Key class.
 * @param clsV Value class.
 * @return Cache configuration.
 */
@SuppressWarnings("unchecked")
private CacheConfiguration cacheConfiguration(@NotNull String name, String sqlSchema, Class<?> clsK,
    Class<?> clsV) {
    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setName(name);
    cc.setCacheMode(CacheMode.PARTITIONED);
    cc.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    cc.setNearConfiguration(null);
    cc.setWriteSynchronizationMode(FULL_SYNC);
    cc.setRebalanceMode(SYNC);
    cc.setSqlSchema(sqlSchema);
    cc.setSqlFunctionClasses(GridQueryParsingTest.class);
    cc.setIndexedTypes(clsK, clsV);

    if (!QueryUtils.isSqlType(clsK))
        cc.setKeyConfiguration(new CacheKeyConfiguration(clsK));

    return cc;
}
 
开发者ID:apache,项目名称:ignite,代码行数:27,代码来源:GridQueryParsingTest.java

示例2: apply

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param config      the akka configuration object
 * @param actorSystem the akk actor system
 * @return the created snapshot ignite cache
 */
@Override
public IgniteCache<Long, SnapshotItem> apply(Config config, ActorSystem actorSystem) {
    final IgniteExtension extension = IgniteExtensionProvider.EXTENSION.get(actorSystem);
    final String cachePrefix = config.getString(CACHE_PREFIX_PROPERTY);
    final int cacheBackups = config.getInt(CACHE_BACKUPS);
    final CacheConfiguration<Long, SnapshotItem> eventStore = new CacheConfiguration();
    eventStore.setCopyOnRead(false);
    if (cacheBackups > 0) {
        eventStore.setBackups(cacheBackups);
    } else {
        eventStore.setBackups(1);
    }
    eventStore.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    eventStore.setName(cachePrefix + "_SNAPSHOT");
    eventStore.setCacheMode(CacheMode.PARTITIONED);
    eventStore.setReadFromBackup(true);
    eventStore.setIndexedTypes(Long.class, SnapshotItem.class);
    eventStore.setIndexedTypes(String.class, SnapshotItem.class);
    return extension.getIgnite().getOrCreateCache(eventStore);
}
 
开发者ID:Romeh,项目名称:akka-persistance-ignite,代码行数:26,代码来源:SnapshotCacheProvider.java

示例3: createCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Creates cache with full configuration. Active store is used.
 *
 * @param cacheName name of cache.
 * @param atomicityMode atomicity.
 * @param cacheMode mode.
 * @param writeBehindEnabled should write behind be used for active store.
 * @param flushFreq flush frequency for write behind.
 * @param base configuration to copy settings from.
 * @param <K> type of key.
 * @param <V> type of value
 * @return cache instance.
 */
@SuppressWarnings("unchecked")
public <K, V> IgniteCache<K, V> createCache(String cacheName, CacheAtomicityMode atomicityMode, CacheMode cacheMode,
    boolean writeBehindEnabled, int flushFreq,
    CacheConfiguration<K, V> base) {
    CacheConfiguration<K, V> realConfiguration = base == null
        ? new CacheConfiguration<K, V>()
        : new CacheConfiguration<K, V>(base);
    realConfiguration.setName(cacheName);
    realConfiguration.setAtomicityMode(atomicityMode);
    realConfiguration.setCacheMode(cacheMode);
    realConfiguration.setBackups(2);
    realConfiguration.setWriteThrough(true);
    realConfiguration.setReadThrough(true);
    realConfiguration.setWriteBehindEnabled(writeBehindEnabled);
    realConfiguration.setWriteBehindFlushFrequency(flushFreq);
    realConfiguration.setCacheStoreFactory(activeStoreConfiguration.activeCacheStoreFactory());
    return ignite().createCache(realConfiguration);
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:32,代码来源:TestResources.java

示例4: newCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create new ML cache if needed.
 */
private IgniteCache<MatrixBlockKey, MatrixBlockEntry> newCache() {
    CacheConfiguration<MatrixBlockKey, MatrixBlockEntry> cfg = new CacheConfiguration<>();

    // Write to primary.
    cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);

    // Atomic transactions only.
    cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);

    // No eviction.
    cfg.setEvictionPolicy(null);

    // No copying of values.
    cfg.setCopyOnRead(false);

    // Cache is partitioned.
    cfg.setCacheMode(CacheMode.PARTITIONED);

    // Random cache name.
    cfg.setName(CACHE_NAME);

    return Ignition.localIgnite().getOrCreateCache(cfg);
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:27,代码来源:BlockMatrixStorage.java

示例5: newCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create new ML cache if needed.
 */
private IgniteCache<VectorBlockKey, VectorBlockEntry> newCache() {
    CacheConfiguration<VectorBlockKey, VectorBlockEntry> cfg = new CacheConfiguration<>();

    // Write to primary.
    cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);

    // Atomic transactions only.
    cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);

    // No eviction.
    cfg.setEvictionPolicy(null);

    // No copying of values.
    cfg.setCopyOnRead(false);

    // Cache is partitioned.
    cfg.setCacheMode(CacheMode.PARTITIONED);

    // Random cache name.
    cfg.setName(CACHE_NAME);

    return Ignition.localIgnite().getOrCreateCache(cfg);
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:27,代码来源:BlockVectorStorage.java

示例6: newCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create new ML cache if needed.
 */
private IgniteCache<RowColMatrixKey, Double> newCache() {
    CacheConfiguration<RowColMatrixKey, Double> cfg = new CacheConfiguration<>();

    // Write to primary.
    cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);

    // Atomic transactions only.
    cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);

    // No eviction.
    cfg.setEvictionPolicy(null);

    // No copying of values.
    cfg.setCopyOnRead(false);

    // Cache is partitioned.
    cfg.setCacheMode(CacheMode.PARTITIONED);

    // Random cache name.
    cfg.setName(CACHE_NAME);

    return Ignition.localIgnite().getOrCreateCache(cfg);
}
 
开发者ID:Luodian,项目名称:Higher-Cloud-Computing-Project,代码行数:27,代码来源:SparseDistributedVectorStorage.java

示例7: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @return Cache configuration.
 */
@SuppressWarnings("unchecked")
protected CacheConfiguration cacheConfiguration() {
    CacheConfiguration cc = defaultCacheConfiguration();

    // Template
    cc.setName("*");

    cc.setRebalanceMode(SYNC);

    cc.setCacheStoreFactory(singletonFactory(store));
    cc.setReadThrough(true);
    cc.setWriteThrough(true);
    cc.setLoadPreviousValue(true);
    cc.setStoreKeepBinary(true);

    cc.setCacheMode(cacheMode());
    cc.setWriteSynchronizationMode(cacheWriteSynchronizationMode());

    cc.setBackups(0);

    cc.setAtomicityMode(CacheAtomicityMode.ATOMIC);

    return cc;
}
 
开发者ID:apache,项目名称:ignite,代码行数:28,代码来源:GridCacheStoreManagerDeserializationTest.java

示例8: getConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    c.getTransactionConfiguration().setDefaultTxConcurrency(OPTIMISTIC);
    c.getTransactionConfiguration().setDefaultTxIsolation(READ_COMMITTED);

    CacheConfiguration cc1 = defaultCacheConfiguration();

    cc1.setName("one");
    cc1.setCacheMode(REPLICATED);
    cc1.setWriteSynchronizationMode(FULL_SYNC);
    cc1.setRebalanceMode(preloadMode);
    cc1.setEvictionPolicy(null);
    cc1.setCacheStoreFactory(null);

    // Identical configuration.
    CacheConfiguration cc2 = new CacheConfiguration(cc1);

    cc2.setName("two");

    c.setCacheConfiguration(cc1, cc2);

    return c;
}
 
开发者ID:apache,项目名称:ignite,代码行数:26,代码来源:GridCacheReplicatedPreloadLifecycleSelfTest.java

示例9: cacheConfigurations

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param grp Group name.
 * @param atomicityMode Atomicity mode.
 * @return Cache configurations.
 */
private List<CacheConfiguration> cacheConfigurations(@Nullable String grp, CacheAtomicityMode atomicityMode) {
    List<CacheConfiguration> ccfgs = new ArrayList<>();

    for (int i = 0; i < 3; i++) {
        CacheConfiguration ccfg = new CacheConfiguration();

        ccfg.setGroupName(grp);
        ccfg.setName("cache-" + atomicityMode + "-" + i);
        ccfg.setWriteSynchronizationMode(FULL_SYNC);

        ccfgs.add(ccfg);
    }

    return ccfgs;
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:IgniteDynamicClientCacheStartSelfTest.java

示例10: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param cacheMode Cache mode.
 * @param backups Number of backups.
 * @param atomicityMode Cache atomicity mode.
 * @param writeMode Write sync mode.
 * @return Cache configuration.
 */
protected CacheConfiguration<Object, Object> cacheConfiguration(
    CacheMode cacheMode,
    int backups,
    CacheAtomicityMode atomicityMode,
    CacheWriteSynchronizationMode writeMode) {
    CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    ccfg.setName("test-cache-" + atomicityMode + "-" + cacheMode + "-" + writeMode + "-" + backups);
    ccfg.setAtomicityMode(atomicityMode);
    ccfg.setCacheMode(cacheMode);
    ccfg.setWriteSynchronizationMode(writeMode);

    if (cacheMode == PARTITIONED)
        ccfg.setBackups(backups);

    return ccfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:CacheContinuousQueryOperationFromCallbackTest.java

示例11: getConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration ccfg = defaultCacheConfiguration();

    ccfg.setName(CACHE);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setBackups(1);
    ccfg.setNearConfiguration(null);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:TxDeadlockDetectionNoHangsTest.java

示例12: apply

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @param config      the akka configuration object
 * @param actorSystem the akk actor system
 * @return the created journal and sequence ignite caches†
 */
@Override
public JournalCaches apply(Config config, ActorSystem actorSystem) {
    final IgniteExtension extension = IgniteExtensionProvider.EXTENSION.get(actorSystem);
    final String cachePrefix = config.getString(CACHE_PREFIX_PROPERTY);
    final int cacheBackups = config.getInt(CACHE_BACKUPS);
    // cache configuration
    final CacheConfiguration<Long, JournalItem> eventStore = new CacheConfiguration();
    eventStore.setCopyOnRead(false);
    if (cacheBackups > 0) {
        eventStore.setBackups(cacheBackups);
    } else {
        eventStore.setBackups(1);
    }
    eventStore.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    eventStore.setName(cachePrefix);
    eventStore.setCacheMode(CacheMode.PARTITIONED);
    eventStore.setReadFromBackup(true);
    eventStore.setIndexedTypes(Long.class, JournalItem.class);
    eventStore.setIndexedTypes(String.class, JournalItem.class);
    eventStore.setInterceptor(new JournalStoreInterceptor());

    //sequence Number Tracking
    final CacheConfiguration<String, Long> squenceNumberTrack = new CacheConfiguration();
    squenceNumberTrack.setCopyOnRead(false);
    if (cacheBackups > 0) {
        squenceNumberTrack.setBackups(cacheBackups);
    } else {
        squenceNumberTrack.setBackups(1);
    }
    squenceNumberTrack.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    squenceNumberTrack.setName("sequenceNumberTrack");
    squenceNumberTrack.setCacheMode(CacheMode.PARTITIONED);
    squenceNumberTrack.setReadFromBackup(true);
    return JournalCaches.builder()
            .journalCache(extension.getIgnite().getOrCreateCache(eventStore))
            .sequenceCache(extension.getIgnite().getOrCreateCache(squenceNumberTrack))
            .build();
}
 
开发者ID:Romeh,项目名称:akka-persistance-ignite,代码行数:44,代码来源:JournalCacheProvider.java

示例13: getConfig

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
@NotNull
public static CacheConfiguration<String, Object> getConfig() {
    CacheConfiguration<String, Object> atomics = new CacheConfiguration<>();
    atomics.setName(NAME);
    atomics.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    atomics.setCacheMode(CacheMode.REPLICATED);
    return atomics;
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:9,代码来源:MetadataAtomicsHelper.java

示例14: createSimpleCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Creates cache with minimal configuration. Active store is not used.
 *
 * @param cacheName name of cache.
 * @param atomicityMode atomicity.
 * @param cacheMode mode.
 * @param base configuration to copy settings from.
 * @param <K> type of key.
 * @param <V> type of value
 * @return cache instance.
 */
public <K, V> IgniteCache<K, V> createSimpleCache(String cacheName, CacheAtomicityMode atomicityMode,
    CacheMode cacheMode, CacheConfiguration<K, V> base) {
    CacheConfiguration<K, V> realConfiguration = base == null
        ? new CacheConfiguration<K, V>()
        : new CacheConfiguration<K, V>(base);
    realConfiguration.setName(cacheName);
    realConfiguration.setAtomicityMode(atomicityMode);
    realConfiguration.setCacheMode(cacheMode);
    realConfiguration.setBackups(2);
    return ignite().createCache(realConfiguration);
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:23,代码来源:TestResources.java

示例15: getConfig

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
public static CacheConfiguration<String, Object> getConfig() {
    CacheConfiguration<String, Object> atomics = new CacheConfiguration<>();
    atomics.setName(NAME);
    atomics.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    atomics.setCacheMode(CacheMode.REPLICATED);
    return atomics;
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:8,代码来源:AtomicsHelper.java


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