Java Code Examples for org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi#setAckTimeout()
The following examples show how to use
org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi#setAckTimeout() .
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: GridDiscoveryManagerAliveCacheSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cCfg = defaultCacheConfiguration(); cCfg.setCacheMode(PARTITIONED); cCfg.setBackups(1); cCfg.setNearConfiguration(new NearCacheConfiguration()); cCfg.setRebalanceMode(SYNC); cCfg.setWriteSynchronizationMode(FULL_SYNC); TcpDiscoverySpi disc = (TcpDiscoverySpi)cfg.getDiscoverySpi(); if (clientMode && ((igniteInstanceName.charAt(igniteInstanceName.length() - 1) - '0') & 1) != 0) cfg.setClientMode(true); else cfg.setClientFailureDetectionTimeout(50000); disc.setAckTimeout(1000); disc.setSocketTimeout(1000); cfg.setCacheConfiguration(cCfg); cfg.setMetricsUpdateFrequency(500); return cfg; }
Example 2
Source File: IgniteCacheAbstractTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); TcpDiscoverySpi disco = (TcpDiscoverySpi)cfg.getDiscoverySpi(); disco.setForceServerMode(true); if (isDebug()) disco.setAckTimeout(Integer.MAX_VALUE); MemoryEventStorageSpi evtSpi = new MemoryEventStorageSpi(); evtSpi.setExpireCount(100); cfg.setEventStorageSpi(evtSpi); cfg.setDiscoverySpi(disco); cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName)); return cfg; }
Example 3
Source File: GridCachePutAllFailoverSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @SuppressWarnings("unchecked") @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); cfg.setPeerClassLoadingEnabled(false); cfg.setDeploymentMode(DeploymentMode.CONTINUOUS); TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi)cfg.getDiscoverySpi(); discoverySpi.setAckTimeout(60000); discoverySpi.setForceServerMode(true); cfg.setDiscoverySpi(discoverySpi); if (igniteInstanceName.startsWith("master")) { cfg.setUserAttributes(ImmutableMap.of("segment", "master")); // For sure. failoverSpi.setMaximumFailoverAttempts(100); cfg.setFailoverSpi(failoverSpi); } else if (igniteInstanceName.startsWith("worker")) { cfg.setUserAttributes(ImmutableMap.of("segment", "worker")); CacheConfiguration cacheCfg = defaultCacheConfiguration(); cacheCfg.setName("partitioned"); cacheCfg.setAtomicityMode(atomicityMode()); cacheCfg.setCacheMode(PARTITIONED); cacheCfg.setBackups(backups); cacheCfg.setNearConfiguration(nearEnabled ? new NearCacheConfiguration() : null); cacheCfg.setWriteSynchronizationMode(FULL_SYNC); cfg.setCacheConfiguration(cacheCfg); } else throw new IllegalStateException("Unexpected Ignite instance name: " + igniteInstanceName); return cfg; }
Example 4
Source File: GridCacheAbstractSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); TcpDiscoverySpi disco = new TcpDiscoverySpi(); disco.setIpFinder(ipFinder); if (isDebug()) disco.setAckTimeout(Integer.MAX_VALUE); cfg.setDiscoverySpi(disco); cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName)); TcpCommunicationSpi comm = new TcpCommunicationSpi(); comm.setSharedMemoryPort(-1); cfg.setCommunicationSpi(comm); return cfg; }