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


Java IgniteConfiguration.setBinaryConfiguration方法代码示例

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


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

示例1: getConfiguration

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

    CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    cacheCfg.setCacheMode(cacheMode());
    cacheCfg.setAtomicityMode(atomicityMode());
    cacheCfg.setNearConfiguration(nearConfiguration());
    cacheCfg.setWriteSynchronizationMode(writeSynchronizationMode());

    cfg.setCacheConfiguration(cacheCfg);

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setTypeConfigurations(Arrays.asList(
        new BinaryTypeConfiguration(TestObject.class.getName())));

    cfg.setBinaryConfiguration(bCfg);
    cfg.setMarshaller(new BinaryMarshaller());

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

示例2: getConfiguration

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

    cfg.setMarshaller(new BinaryMarshaller());
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));

    cfg.setCacheConfiguration(
        new CacheConfiguration(cacheName)
            .setCopyOnRead(true)
    );

    BinaryConfiguration bcfg = new BinaryConfiguration()
            .setNameMapper(new BinaryBasicNameMapper(false));

    cfg.setBinaryConfiguration(bcfg);

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

示例3: apply

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Override
public Ignite apply(ExtendedActorSystem system) {
    final IgniteProperties properties = igniteConfigProvider.apply(system);
    final IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
    igniteConfiguration.setClientMode(properties.isClientNode());
    // durable file memory persistence
    if (properties.isEnableFilePersistence()) {
        DataStorageConfiguration persistentStoreConfiguration = new DataStorageConfiguration();
        persistentStoreConfiguration.setStoragePath(properties.getIgnitePersistenceFilePath() + "/data/store");
        persistentStoreConfiguration.setWalArchivePath(properties.getIgnitePersistenceFilePath() + "./data/walArchive");
        igniteConfiguration.setDataStorageConfiguration(persistentStoreConfiguration);
    }
    // connector configuration
    final ConnectorConfiguration connectorConfiguration = new ConnectorConfiguration();
    connectorConfiguration.setPort(properties.getIgniteConnectorPort());
    // common ignite configuration
    igniteConfiguration.setMetricsLogFrequency(properties.getMetricsLogFrequency());
    igniteConfiguration.setQueryThreadPoolSize(properties.getQueryThreadPoolSize());
    igniteConfiguration.setDataStreamerThreadPoolSize(properties.getDataStreamerThreadPoolSize());
    igniteConfiguration.setManagementThreadPoolSize(properties.getManagementThreadPoolSize());
    igniteConfiguration.setPublicThreadPoolSize(properties.getPublicThreadPoolSize());
    igniteConfiguration.setSystemThreadPoolSize(properties.getSystemThreadPoolSize());
    igniteConfiguration.setRebalanceThreadPoolSize(properties.getRebalanceThreadPoolSize());
    igniteConfiguration.setAsyncCallbackPoolSize(properties.getAsyncCallbackPoolSize());
    igniteConfiguration.setPeerClassLoadingEnabled(properties.isPeerClassLoadingEnabled());

    final BinaryConfiguration binaryConfiguration = new BinaryConfiguration();
    binaryConfiguration.setCompactFooter(false);
    igniteConfiguration.setBinaryConfiguration(binaryConfiguration);
    // cluster tcp configuration
    final TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
    final TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder();
    // need to be changed when it come to real cluster configuration
    tcpDiscoveryVmIpFinder.setAddresses(Arrays.asList(properties.getTcpDiscoveryAddresses() + properties.getIgniteServerPortRange()));
    tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);
    igniteConfiguration.setDiscoverySpi(new TcpDiscoverySpi());
    final Ignite ignite = Ignition.start(igniteConfiguration);
    Runtime.getRuntime().addShutdownHook(new Thread(ignite::close));
    return ignite;
}
 
开发者ID:Romeh,项目名称:akka-persistance-ignite,代码行数:41,代码来源:IgniteFactoryByConfig.java

示例4: createConfig

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
private IgniteConfiguration createConfig() {
	IgniteConfiguration config = new IgniteConfiguration();
	config.setClientMode( false );
	BinaryConfiguration binaryConfiguration = new BinaryConfiguration();
	binaryConfiguration.setNameMapper( new BinaryBasicNameMapper( true ) );
	binaryConfiguration.setCompactFooter( false );		// it is necessary only for embedded collections (@ElementCollection)
	config.setBinaryConfiguration( binaryConfiguration );
	TransactionConfiguration transactionConfiguration = new TransactionConfiguration();
	transactionConfiguration.setDefaultTxConcurrency( TransactionConcurrency.OPTIMISTIC );
	transactionConfiguration.setDefaultTxIsolation( TransactionIsolation.READ_COMMITTED );
	config.setTransactionConfiguration( transactionConfiguration );

	return config;
}
 
开发者ID:hibernate,项目名称:hibernate-ogm-ignite,代码行数:15,代码来源:IgniteTestConfigurationBuilder.java

示例5: binaryMarshaller

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 *
 */
protected BinaryMarshaller binaryMarshaller(
    BinaryNameMapper nameMapper,
    BinaryIdMapper mapper,
    BinarySerializer serializer,
    Collection<BinaryTypeConfiguration> cfgs
) throws IgniteCheckedException {
    IgniteConfiguration iCfg = new IgniteConfiguration();

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setNameMapper(nameMapper);
    bCfg.setIdMapper(mapper);
    bCfg.setSerializer(serializer);

    bCfg.setTypeConfigurations(cfgs);

    iCfg.setBinaryConfiguration(bCfg);

    BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg, new NullLogger());

    BinaryMarshaller marsh = new BinaryMarshaller();

    marsh.setContext(new MarshallerContextTestImpl(null));

    IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);

    return marsh;
}
 
开发者ID:apache,项目名称:ignite,代码行数:32,代码来源:GridBinaryWildcardsSelfTest.java

示例6: getConfiguration

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

    if (register) {
        BinaryConfiguration bCfg = new BinaryConfiguration();

        BinaryTypeConfiguration enumCfg = new BinaryTypeConfiguration(EnumType.class.getName());

        enumCfg.setEnum(true);

        if (igniteInstanceName.equals(WRONG_CONF_NODE_NAME))
            enumCfg.setEnumValues(F.asMap(EnumType.ONE.name(),
                    EnumType.ONE.ordinal(),
                    EnumType.TWO.name(),
                    EnumType.ONE.ordinal()));
        else
            enumCfg.setEnumValues(F.asMap(EnumType.ONE.name(),
                    EnumType.ONE.ordinal(),
                    EnumType.TWO.name(),
                    EnumType.TWO.ordinal()));

        bCfg.setTypeConfigurations(Arrays.asList(enumCfg, new BinaryTypeConfiguration(EnumHolder.class.getName())));

        cfg.setBinaryConfiguration(bCfg);
    }

    cfg.setMarshaller(new BinaryMarshaller());

    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    ccfg.setName(CACHE_NAME);
    ccfg.setCacheMode(CacheMode.PARTITIONED);

    cfg.setCacheConfiguration(ccfg);

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

示例7: getConfiguration

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

    CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(cacheName);

    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
    ccfg.setIndexedTypes(Integer.class, IndexedObject.class);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 64 * 4)); // 64 per node
    ccfg.setReadFromBackup(true);

    cfg.setCacheConfiguration(ccfg);

    DataStorageConfiguration memCfg = new DataStorageConfiguration()
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration().setMaxSize(500 * 1024 * 1024).setPersistenceEnabled(true))
        .setWalMode(WALMode.LOG_ONLY)
        .setPageSize(PAGE_SIZE);

    cfg.setDataStorageConfiguration(memCfg);

    cfg.setMarshaller(null);

    BinaryConfiguration binCfg = new BinaryConfiguration();

    binCfg.setCompactFooter(false);

    cfg.setBinaryConfiguration(binCfg);

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

示例8: config

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @return Grid configuration.
 */
private IgniteConfiguration config() {
    IgniteConfiguration cfg = new IgniteConfiguration();

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(disco);

    cfg.setUserAttributes(F.asMap(ATTR_KEY, true));

    cfg.setConnectorConfiguration(null);

    cfg.setIgniteInstanceName(getTestIgniteInstanceName());

    cfg.setBinaryConfiguration(new BinaryConfiguration());

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

示例9: beforeTest

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
    super.beforeTest();

    ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(), new NullLogger());

    marsh = new BinaryMarshaller();

    IgniteConfiguration iCfg = new IgniteConfiguration();

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setTypeConfigurations(Arrays.asList(new BinaryTypeConfiguration(TestObject.class.getName())));

    bCfg.setCompactFooter(compactFooter());

    iCfg.setBinaryConfiguration(bCfg);

    marsh.setContext(new MarshallerContextTestImpl(null));

    IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
}
 
开发者ID:apache,项目名称:ignite,代码行数:23,代码来源:BinaryFooterOffsetsAbstractSelfTest.java

示例10: createMarshaller

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * Create marshaller.
 *
 * @return Binary marshaller.
 * @throws Exception If failed.
 */
protected BinaryMarshaller createMarshaller() throws Exception {
    BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration(),
        log());

    BinaryMarshaller marsh = new BinaryMarshaller();

    BinaryConfiguration bCfg = new BinaryConfiguration();

    IgniteConfiguration iCfg = new IgniteConfiguration();

    iCfg.setBinaryConfiguration(bCfg);

    marsh.setContext(new MarshallerContextTestImpl(null));

    IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);

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

示例11: getConfiguration

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

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);

    CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    cacheCfg.setCacheMode(cacheMode());
    cacheCfg.setAtomicityMode(atomicityMode());
    cacheCfg.setNearConfiguration(nearConfiguration());
    cacheCfg.setWriteSynchronizationMode(writeSynchronizationMode());

    cfg.setCacheConfiguration(cacheCfg);

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setTypeConfigurations(Arrays.asList(
        new BinaryTypeConfiguration(TestObject.class.getName())));

    cfg.setBinaryConfiguration(bCfg);
    cfg.setMarshaller(new BinaryMarshaller());

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

示例12: binaryMarshaller

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @return Binary marshaller.
 * @throws IgniteCheckedException if failed.
 */
private BinaryMarshaller binaryMarshaller() throws IgniteCheckedException {
    IgniteConfiguration iCfg = new IgniteConfiguration();

    BinaryConfiguration bCfg = new BinaryConfiguration();

    iCfg.setBinaryConfiguration(bCfg);

    BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg, new NullLogger());

    BinaryMarshaller marsh = new BinaryMarshaller();

    marsh.setContext(new MarshallerContextTestImpl(null));

    IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);

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

示例13: getConfiguration

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

    cfg.setClientMode(isClient);

    cfg.setMarshaller(new BinaryMarshaller());

    cfg.setBinaryConfiguration(binaryCfg);

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

示例14: getConfiguration

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

    BinaryMarshaller marsh = new BinaryMarshaller();

    BinaryConfiguration bCfg = new BinaryConfiguration();

    bCfg.setClassNames(Arrays.asList(TestObject1.class.getName(), TestObject2.class.getName()));

    BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();

    typeCfg.setTypeName(TestObject1.class.getName());

    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject1.class.getName(), "val2");

    cfg.setCacheKeyConfiguration(keyCfg);

    bCfg.setTypeConfigurations(Arrays.asList(typeCfg));

    cfg.setBinaryConfiguration(bCfg);

    if (igniteInstanceName.equals(getTestIgniteInstanceName(gridCount() - 1)))
        cfg.setClientMode(true);

    cfg.setMarshaller(marsh);

    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);

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

示例15: getConfiguration

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

    final ServiceConfiguration scfg = new ServiceConfiguration();

    if (igniteInstanceName.endsWith("0")) {
        scfg.setName("testService");
        scfg.setService(srvc);
        scfg.setMaxPerNodeCount(1);
        scfg.setTotalCount(1);
        scfg.setNodeFilter(new NodeFilter());

        final Map<String, String> attrs = new HashMap<>();

        attrs.put("clusterGroup", "0");

        cfg.setUserAttributes(attrs);

        cfg.setServiceConfiguration(scfg);
    }

    cfg.setMarshaller(null);

    final BinaryConfiguration binCfg = new BinaryConfiguration();

    // Despite defaults explicitly set to lower case.
    binCfg.setIdMapper(new BinaryBasicIdMapper(true));

    cfg.setBinaryConfiguration(binCfg);

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


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