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


Java CacheConfiguration.setCopyOnRead方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: getConfiguration

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

    CacheConfiguration<String, Long> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setBackups(1);
    ccfg.setReadFromBackup(true);
    ccfg.setCopyOnRead(false);
    ccfg.setName(THROTTLES_CACHE_NAME);

    Duration expiryDuration = new Duration(TimeUnit.MINUTES, 1);

    ccfg.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(expiryDuration));
    ccfg.setReadThrough(false);
    ccfg.setWriteThrough(true);

    ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory<>(new TestCacheStore()));

    cfg.setCacheConfiguration(ccfg);

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

示例6: utilitySystemCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Creates utility system cache configuration.
 *
 * @return Utility system cache configuration.
 */
private static CacheConfiguration utilitySystemCache() {
    CacheConfiguration cache = new CacheConfiguration();

    cache.setName(CU.UTILITY_CACHE_NAME);
    cache.setCacheMode(REPLICATED);
    cache.setAtomicityMode(TRANSACTIONAL);
    cache.setRebalanceMode(SYNC);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setAffinity(new RendezvousAffinityFunction(false, 100));
    cache.setNodeFilter(CacheConfiguration.ALL_NODES);
    cache.setRebalanceOrder(-2); //Prior to user caches.
    cache.setCopyOnRead(false);

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

示例7: 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

示例8: newCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create new ML cache if needed.
 */
private IgniteCache<RowColMatrixKey, Map<Integer, Double>> newCache() {
    CacheConfiguration<RowColMatrixKey, Map<Integer, 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);

    // TODO: Possibly we should add a fix of https://issues.apache.org/jira/browse/IGNITE-6862 here commented below.
    // cfg.setReadFromBackup(false);

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

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

示例9: getOrCreate

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Get or create cache for training context.
 *
 * @param ignite Ignite instance.
 * @param <D> Class storing information about continuous regions.
 * @return Cache for training context.
 */
public static <D extends ContinuousRegionInfo> IgniteCache<UUID, TrainingContext<D>> getOrCreate(Ignite ignite) {
    CacheConfiguration<UUID, TrainingContext<D>> cfg = new CacheConfiguration<>();

    cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);

    cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);

    cfg.setEvictionPolicy(null);

    cfg.setCopyOnRead(false);

    cfg.setCacheMode(CacheMode.REPLICATED);

    cfg.setOnheapCacheEnabled(true);

    cfg.setReadFromBackup(true);

    cfg.setName(COLUMN_DECISION_TREE_TRAINER_CONTEXT_CACHE_NAME);

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

示例10: createNew

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create new labeled vectors cache.
 *
 * @param ignite Ignite instance.
 * @return new labeled vectors cache.
 */
public static IgniteCache<Integer, LabeledVector<Vector, Vector>> createNew(Ignite ignite) {
    CacheConfiguration<Integer, LabeledVector<Vector, Vector>> cfg = new CacheConfiguration<>();

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

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

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

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

    cfg.setBackups(0);

    cfg.setOnheapCacheEnabled(true);

    cfg.setName("LBLD_VECS_" + UUID.randomUUID().toString());

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

示例11: getOrCreate

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Get or create region projections cache.
 *
 * @param ignite Ignite instance.
 * @return Region projections cache.
 */
public static IgniteCache<UUID, MLPGroupUpdateTrainingData> getOrCreate(Ignite ignite) {
    CacheConfiguration<UUID, MLPGroupUpdateTrainingData> cfg = new CacheConfiguration<>();

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

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

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

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

    cfg.setBackups(0);

    cfg.setOnheapCacheEnabled(true);

    cfg.setName(CACHE_NAME);

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

示例12: getOrCreate

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Get or create region projections cache.
 *
 * @param ignite Ignite instance.
 * @return Region projections cache.
 */
public static IgniteCache<GroupTrainerCacheKey<Void>, MLPGroupTrainingCacheValue> getOrCreate(Ignite ignite) {
    CacheConfiguration<GroupTrainerCacheKey<Void>, MLPGroupTrainingCacheValue> cfg = new CacheConfiguration<>();

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

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

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

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

    cfg.setBackups(0);

    cfg.setOnheapCacheEnabled(true);

    cfg.setName(CACHE_NAME);

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

示例13: getOrCreate

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Get or create region projections cache.
 *
 * @param ignite Ignite instance.
 * @return Region projections cache.
 */
public static IgniteCache<UUID, MLPGroupUpdateTrainingData> getOrCreate(Ignite ignite) {
    CacheConfiguration<UUID, MLPGroupUpdateTrainingData> cfg = new CacheConfiguration<>();

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

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

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

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

    cfg.setBackups(0);

    cfg.setOnheapCacheEnabled(true);

    cfg.setName(CACHE_NAME);

    return ignite.getOrCreateCache(cfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:30,代码来源:MLPGroupUpdateTrainerDataCache.java

示例14: createBiIndexedCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Creates cache where data for training is stored.
 *
 * @param ignite Ignite instance.
 * @return cache where data for training is stored.
 */
private static IgniteCache<BiIndex, Double> createBiIndexedCache(Ignite ignite) {
    CacheConfiguration<BiIndex, 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);

    cfg.setBackups(0);

    cfg.setName("TMP_BI_INDEXED_CACHE");

    return ignite.getOrCreateCache(cfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:31,代码来源:MNISTExample.java

示例15: createBiIndexedCache

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * Create bi-indexed cache for tests.
 *
 * @return Bi-indexed cache.
 */
private IgniteCache<BiIndex, Double> createBiIndexedCache() {
    CacheConfiguration<BiIndex, 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);

    cfg.setBackups(0);

    cfg.setName("TMP_BI_INDEXED_CACHE");

    return Ignition.localIgnite().getOrCreateCache(cfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:30,代码来源:ColumnDecisionTreeTrainerBenchmark.java


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