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


Java IgniteConfiguration.setNetworkTimeout方法代码示例

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


在下文中一共展示了IgniteConfiguration.setNetworkTimeout方法的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);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    cfg.setNetworkTimeout(2000);

    CacheConfiguration cacheCfg = defaultCacheConfiguration();

    cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setBackups(1);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    cacheCfg.setEvictionPolicy(null);
    cacheCfg.setIndexedTypes(Integer.class, TestValue.class);
    cacheCfg.setNearConfiguration(null);

    cfg.setCacheConfiguration(cacheCfg);

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

示例2: copyDefaultsFromSource

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * @param cfg Config.
 * @param srcCfg Source config.
 */
private static void copyDefaultsFromSource(IgniteConfiguration cfg, IgniteConfiguration srcCfg) {
    cfg.setIgniteInstanceName(srcCfg.getIgniteInstanceName());
    cfg.setGridLogger(srcCfg.getGridLogger());
    cfg.setNodeId(srcCfg.getNodeId());
    cfg.setIgniteHome(srcCfg.getIgniteHome());
    cfg.setMBeanServer(srcCfg.getMBeanServer());
    cfg.setMetricsLogFrequency(srcCfg.getMetricsLogFrequency());
    cfg.setConnectorConfiguration(srcCfg.getConnectorConfiguration());
    cfg.setCommunicationSpi(srcCfg.getCommunicationSpi());
    cfg.setNetworkTimeout(srcCfg.getNetworkTimeout());
    cfg.setDiscoverySpi(srcCfg.getDiscoverySpi());
    cfg.setCheckpointSpi(srcCfg.getCheckpointSpi());
    cfg.setIncludeEventTypes(srcCfg.getIncludeEventTypes());

    // Specials.
    ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
    ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
    cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
}
 
开发者ID:apache,项目名称:ignite,代码行数:24,代码来源:ConfigVariationsFactory.java

示例3: getDefaultConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
 * Default Ignite configuration without the {#TcpDiscoveryRedisIpFinder}.
 *
 * @param gridName Grid name.
 * @return Ignite configuration
 * @throws Exception If failed.
 */
protected IgniteConfiguration getDefaultConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setGridName(gridName);
    cfg.setLocalHost("127.0.0.1");
    cfg.setGridLogger(new Slf4jLogger());
    cfg.setNetworkTimeout(10000);
    return cfg;
}
 
开发者ID:aalda,项目名称:ignite-redis,代码行数:16,代码来源:TcpDiscoveryIpFinderBaseTest.java

示例4: getConfiguration

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

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(PARTITIONED);
    cc.setRebalanceBatchSize(preloadBatchSize);
    cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cc.setRebalanceMode(preloadMode);
    cc.setAffinity(new RendezvousAffinityFunction(false, partitions));
    cc.setBackups(backups);
    cc.setAtomicityMode(TRANSACTIONAL);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    if (lbean != null)
        c.setLifecycleBeans(lbean);

    c.setDiscoverySpi(disco);
    c.setCacheConfiguration(cc);
    c.setDeploymentMode(CONTINUOUS);
    c.setNetworkTimeout(netTimeout);

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

示例5: getConfiguration

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

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(PARTITIONED);
    cc.setRebalanceBatchSize(preloadBatchSize);
    cc.setWriteSynchronizationMode(FULL_SYNC);
    cc.setRebalanceMode(preloadMode);
    cc.setAffinity(new RendezvousAffinityFunction(false, partitions));
    cc.setBackups(backups);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    if (lbean != null)
        c.setLifecycleBeans(lbean);

    c.setDiscoverySpi(disco);
    c.setCacheConfiguration(cc);
    c.setDeploymentMode(CONTINUOUS);
    c.setNetworkTimeout(1000);

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

示例6: getConfiguration

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

        TcpDiscoverySpi disco = new TcpDiscoverySpi();

        disco.setIpFinder(ipFinder);

        c.setDiscoverySpi(disco);

        c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        c.setIncludeProperties();
        c.setDeploymentMode(DeploymentMode.SHARED);
        c.setNetworkTimeout(10000);
        c.setConnectorConfiguration(null);

//        c.setPeerClassLoadingLocalClassPathExclude(GridCachePreloadLifecycleAbstractTest.class.getName(),
//            MyValue.class.getName());

        c.setPublicThreadPoolSize(10);
        c.setSystemThreadPoolSize(10);
        c.setPeerClassLoadingThreadPoolSize(3);

        c.setLifecycleBeans(lifecycleBean);

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

示例7: getConfiguration

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

    cfg.setNetworkTimeout(500);
    cfg.setCommunicationSpi(new TcpCommunicationSpi(gridName.contains("block")));

    if (gridName.contains("client")) {
        cfg.setClientMode(true);
    }

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

示例8: getConfiguration

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

    cfg.setDeploymentMode(depMode);
    cfg.setNetworkTimeout(10000);

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    discoSpi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(discoSpi);

    if (igniteInstanceName.contains("testCacheRedeployVersionChangeContinuousMode")) {
        CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

        cacheCfg.setCacheMode(CacheMode.REPLICATED);

        cfg.setCacheConfiguration(cacheCfg);
    }
    else
        cfg.setCacheConfiguration();

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

示例9: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的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);

    cfg.setNetworkTimeout(2000);

    cfg.setDeploymentMode(SHARED);

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

示例10: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的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);

    cfg.setNetworkTimeout(2000);

    CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();

    cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg.setCacheMode(REPLICATED);
    cacheCfg.setIndexedTypes(Integer.class, CacheValue.class);

    cfg.setCacheConfiguration(cacheCfg);

    cfg.setDeploymentMode(SHARED);

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

示例11: getConfiguration

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

    c.getTransactionConfiguration().setTxSerializableEnabled(true);
    c.getTransactionConfiguration().setDefaultTxTimeout(50);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));

    c.setDiscoverySpi(disco);

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(LOCAL);

    c.setCacheConfiguration(cc);

    c.setNetworkTimeout(1000);

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

示例12: getConfiguration

import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的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);

    cfg.setNetworkTimeout(2000);

    CacheConfiguration cacheCfg = defaultCacheConfiguration();

    cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg.setCacheMode(cacheMode);
    cacheCfg.setRebalanceMode(SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);

    if (cacheMode == PARTITIONED)
        cacheCfg.setBackups(1);

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
开发者ID:apache,项目名称:ignite,代码行数:27,代码来源:GridCacheSwapPreloadSelfTest.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.setNetworkTimeout(2000);

        TcpDiscoverySpi spi = new TcpDiscoverySpi();

        spi.setIpFinder(ipFinder);

        cfg.setDiscoverySpi(spi);

        cfg.setMarshaller(new JdkMarshaller());

        CacheConfiguration repCacheCfg = defaultCacheConfiguration();

        repCacheCfg.setName("replicated");
        repCacheCfg.setCacheMode(REPLICATED);
        repCacheCfg.setRebalanceMode(mode);
        repCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
        repCacheCfg.setAtomicityMode(TRANSACTIONAL);

        // TODO GG-10884.
//        if (offheap)
//            repCacheCfg.setOffHeapMaxMemory(OFFHEAP);
//        else
//            repCacheCfg.setSwapEnabled(true);

        CacheConfiguration partCacheCfg = defaultCacheConfiguration();

        partCacheCfg.setName("partitioned");
        partCacheCfg.setCacheMode(PARTITIONED);
        partCacheCfg.setRebalanceMode(mode);
        partCacheCfg.setAffinity(new GridCacheModuloAffinityFunction(11, 1));
        partCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
        partCacheCfg.setAtomicityMode(TRANSACTIONAL);

        // TODO GG-10884.
//        if (offheap)
//            partCacheCfg.setOffHeapMaxMemory(OFFHEAP);
//        else
//            partCacheCfg.setSwapEnabled(true);

        cfg.setCacheConfiguration(repCacheCfg, partCacheCfg);

        cfg.setDeploymentMode(SHARED);
        cfg.setPeerClassLoadingLocalClassPathExclude(GridCacheP2PUndeploySelfTest.class.getName());

        cfg.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, idxGen.getAndIncrement()));

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

示例14: getConfiguration

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

    TcpDiscoverySpi spi = new TcpDiscoverySpi();

    spi.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(spi);

    CacheConfiguration partCacheCfg = defaultCacheConfiguration();

    partCacheCfg.setCacheMode(PARTITIONED);
    partCacheCfg.setAffinity(new GridCacheModuloAffinityFunction(1, 1));
    partCacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    partCacheCfg.setNearConfiguration(null);
    partCacheCfg.setEvictionPolicy(null);
    partCacheCfg.setRebalanceMode(ASYNC);
    partCacheCfg.setAtomicityMode(TRANSACTIONAL);

    // This test requires artificial slowing down of the preloading.
    partCacheCfg.setRebalanceThrottle(2000);

    cfg.setCacheConfiguration(partCacheCfg);

    cfg.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, idxGen.getAndIncrement()));

    cfg.setNetworkTimeout(60000);

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

示例15: getConfiguration

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

    // Override P2P configuration to exclude Task and Job classes
    cfg.setPeerClassLoadingLocalClassPathExclude(GridP2PTestTask.class.getName(), GridP2PTestJob.class.getName());

    cfg.setDeploymentMode(depMode);

    cfg.setNetworkTimeout(1000);

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


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