Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setNetworkTimeout()
The following examples show how to use
org.apache.ignite.configuration.IgniteConfiguration#setNetworkTimeout() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GridP2PUserVersionChangeSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDeploymentMode(depMode); cfg.setNetworkTimeout(10000); if (igniteInstanceName.contains("testCacheRedeployVersionChangeContinuousMode")) { CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME); cacheCfg.setCacheMode(CacheMode.REPLICATED); cfg.setCacheConfiguration(cacheCfg); } else cfg.setCacheConfiguration(); cfg.setIncludeEventTypes(EventType.EVTS_ALL); return cfg; }
Example 2
Source File: GridCacheOffheapIndexEntryEvictTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); 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; }
Example 3
Source File: ConfigVariationsFactory.java From ignite with Apache License 2.0 | 6 votes |
/** * @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); }
Example 4
Source File: GridCachePreloadingEvictionsSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); 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; }
Example 5
Source File: GridCacheDhtPreloadUnloadSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@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); if (lbean != null) c.setLifecycleBeans(lbean); c.setCacheConfiguration(cc); c.setDeploymentMode(CONTINUOUS); c.setNetworkTimeout(netTimeout); return c; }
Example 6
Source File: GridCacheDhtPreloadBigDataSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@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); if (lbean != null) c.setLifecycleBeans(lbean); c.setCacheConfiguration(cc); c.setDeploymentMode(CONTINUOUS); c.setNetworkTimeout(1000); return c; }
Example 7
Source File: GridCachePreloadLifecycleAbstractTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration c = super.getConfiguration(igniteInstanceName); 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; }
Example 8
Source File: GridCacheOffHeapSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); 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; }
Example 9
Source File: GridCacheLocalTxTimeoutSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration() throws Exception { MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.LOCAL_CACHE); 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; }
Example 10
Source File: GridCacheP2PUndeploySelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setNetworkTimeout(2000); 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; }
Example 11
Source File: GridCacheOffheapIndexGetSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setNetworkTimeout(2000); cfg.setDeploymentMode(SHARED); return cfg; }
Example 12
Source File: GridP2PTimeoutSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@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; }
Example 13
Source File: GridP2PHotRedeploymentSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@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(TASK_NAME); cfg.setDeploymentMode(depMode); cfg.setNetworkTimeout(P2P_TIMEOUT); return cfg; }
Example 14
Source File: GridAbstractMultinodeRedeployTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDeploymentMode(depMode); cfg.setFailoverSpi(new NeverFailoverSpi()); cfg.setNetworkTimeout(10000); return cfg; }