本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}