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


Java CacheConfiguration.setStoreKeepBinary方法代码示例

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


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

示例1: createEntityCacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
private CacheConfiguration<?,?> createEntityCacheConfiguration(EntityKeyMetadata entityKeyMetadata, SchemaDefinitionContext context) {
	CacheConfiguration<?,?> cacheConfiguration = new CacheConfiguration<>();
	cacheConfiguration.setStoreKeepBinary( true );
	cacheConfiguration.setSqlSchema( QueryUtils.DFLT_SCHEMA );
	cacheConfiguration.setBackups( 1 );
	cacheConfiguration.setName( StringHelper.stringBeforePoint( entityKeyMetadata.getTable() ) );
	cacheConfiguration.setAtomicityMode( CacheAtomicityMode.TRANSACTIONAL );

	QueryEntity queryEntity = new QueryEntity();
	queryEntity.setTableName( entityKeyMetadata.getTable() );
	queryEntity.setKeyType( getEntityIdClassName( entityKeyMetadata.getTable(), context ).getSimpleName() );
	queryEntity.setValueType( StringHelper.stringAfterPoint( entityKeyMetadata.getTable() ) );

	addTableInfo( queryEntity, context, entityKeyMetadata.getTable() );
	for ( AssociationKeyMetadata associationKeyMetadata : context.getAllAssociationKeyMetadata() ) {
		if ( associationKeyMetadata.getAssociationKind() != AssociationKind.EMBEDDED_COLLECTION
				&& associationKeyMetadata.getTable().equals( entityKeyMetadata.getTable() )
				&& !IgniteAssociationSnapshot.isThirdTableAssociation( associationKeyMetadata ) ) {
			appendIndex( queryEntity, associationKeyMetadata, context );
		}
	}
	log.debugf( "queryEntity: %s", queryEntity );
	cacheConfiguration.setQueryEntities( Arrays.asList( queryEntity ) );
	return cacheConfiguration;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-ignite,代码行数:26,代码来源:IgniteCacheInitializer.java

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

示例3: cacheConfiguration

import org.apache.ignite.configuration.CacheConfiguration; //导入方法依赖的package包/类
/**
 * @return Cache configuration for test.
 * @throws Exception In case when failed to create cache configuration.
 */
protected CacheConfiguration cacheConfiguration() throws Exception {
    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setName(CACHE_NAME);
    cc.setCacheMode(PARTITIONED);
    cc.setAtomicityMode(transactional ? TRANSACTIONAL : ATOMIC);
    cc.setWriteBehindEnabled(false);
    cc.setStoreKeepBinary(storeKeepBinary());

    CacheJdbcPojoStoreFactory<Object, Object> storeFactory = new CacheJdbcPojoStoreFactory<>();
    storeFactory.setDialect(new H2Dialect());
    storeFactory.setTypes(storeTypes());
    storeFactory.setDataSourceFactory(new H2DataSourceFactory()); // H2 DataSource factory.
    storeFactory.setSqlEscapeAll(sqlEscapeAll());
    storeFactory.setParallelLoadCacheMinimumThreshold(parallelLoadThreshold);

    cc.setCacheStoreFactory(storeFactory);
    cc.setReadThrough(true);
    cc.setWriteThrough(true);
    cc.setLoadPreviousValue(true);

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

示例4: cacheConfiguration

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

    cc.setStoreKeepBinary(true);

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

示例5: cacheConfiguration

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

    ccfg.setStoreKeepBinary(true);

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

示例6: getConfiguration

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

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    CacheConfiguration ccfg = defaultCacheConfiguration();

    ccfg.setCacheMode(REPLICATED);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);

    ccfg.setStoreKeepBinary(storeValBytes);

    cfg.setCacheConfiguration(ccfg);

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

示例7: getConfiguration

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

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setNameMapper(new BinaryBasicNameMapper(false));
    bCfg.setIdMapper(new BinaryBasicIdMapper(false));

    bCfg.setClassNames(Arrays.asList(Key.class.getName(), Value.class.getName()));

    cfg.setBinaryConfiguration(bCfg);

    cfg.setMarshaller(new BinaryMarshaller());

    CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    cacheCfg.setCacheStoreFactory(singletonFactory(STORE));
    cacheCfg.setStoreKeepBinary(keepBinaryInStore());
    cacheCfg.setReadThrough(true);
    cacheCfg.setWriteThrough(true);
    cacheCfg.setLoadPreviousValue(true);

    cfg.setCacheConfiguration(cacheCfg);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(disco);

    GridCacheBinaryStoreAbstractSelfTest.cfg = cfg;

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

示例8: getConfiguration

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

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(disco);

    CacheConfiguration cacheCfg = createCacheConfig();

    cacheCfg.setCacheStoreFactory(singletonFactory(new TestStore()));

    CacheConfiguration binKeysCacheCfg = createCacheConfig();

    binKeysCacheCfg.setCacheStoreFactory(singletonFactory(new MapCacheStoreStrategy.MapCacheStore()));
    binKeysCacheCfg.setStoreKeepBinary(true);
    binKeysCacheCfg.setName("BinKeysCache");

    cfg.setCacheConfiguration(cacheCfg, binKeysCacheCfg);
    cfg.setMarshaller(new BinaryMarshaller());

    List<BinaryTypeConfiguration> binTypes = new ArrayList<>();

    binTypes.add(new BinaryTypeConfiguration() {{
        setTypeName("ArrayHashedKey");
    }});

    BinaryConfiguration binCfg = new BinaryConfiguration();
    binCfg.setTypeConfigurations(binTypes);

    cfg.setBinaryConfiguration(binCfg);

    CacheKeyConfiguration arrayHashCfg = new CacheKeyConfiguration("ArrayHashedKey", "fld1");

    cfg.setCacheKeyConfiguration(arrayHashCfg);

    GridCacheBinaryObjectsAbstractSelfTest.cfg = cfg;

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


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