本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setCommunicationSpi方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setCommunicationSpi方法的具体用法?Java IgniteConfiguration.setCommunicationSpi怎么用?Java IgniteConfiguration.setCommunicationSpi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setCommunicationSpi方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultIgniteConfig
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
private IgniteConfiguration getDefaultIgniteConfig(IgniteResource gridResource) {
IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
igniteConfiguration.setGridName(getGridName(gridResource));
igniteConfiguration.setClientMode(getClientMode(gridResource));
igniteConfiguration.setPeerClassLoadingEnabled(getPeerClassLoadingEnabled(gridResource));
TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setAddresses(Collections.singletonList(getIpDiscoveryRange(gridResource)));
tcpDiscoverySpi.setIpFinder(ipFinder);
tcpDiscoverySpi.setLocalAddress(getLocalAddress(gridResource));
igniteConfiguration.setDiscoverySpi(tcpDiscoverySpi);
TcpCommunicationSpi communicationSpi = new TcpCommunicationSpi();
communicationSpi.setLocalAddress(props.getLocalAddress());
igniteConfiguration.setCommunicationSpi(communicationSpi);
return igniteConfiguration;
}
示例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);
}
示例3: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
/* Uncomment following code if you start it manually. */
CommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
/*
*/
@SuppressWarnings("TypeMayBeWeakened")
Log4JLogger log = (Log4JLogger)cfg.getGridLogger();
log.getLogger("org.apache.ignite").setLevel(Level.INFO);
return cfg;
}
示例4: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(discoSpi);
cfg.setCommunicationSpi(new StaleTopologyCommunicationSpi());
if (cnt < MAX_CACHE_COUNT)
cfg.setCacheConfiguration(cacheConfiguration());
cnt++;
return cfg;
}
示例5: 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);
TcpCommunicationSpi commSpi = new TestCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
ccfg.setAtomicityMode(atomicityMode());
ccfg.setBackups(1);
cfg.setCacheConfiguration(ccfg);
final TransactionConfiguration txCfg = new TransactionConfiguration();
txCfg.setDefaultTxTimeout(TX_TIMEOUT);
cfg.setTransactionConfiguration(txCfg);
return cfg;
}
示例6: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setConsistentId(igniteInstanceName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder).setForceServerMode(true);
cfg.setClientMode(client);
TestCommunicationSpi commSpi = new TestCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
示例7: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
CacheConfiguration ccfg = new CacheConfiguration("cache");
ccfg.setBackups(1);
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
ccfg.setNodeFilter(new NodeFilter());
TestCommunicationSpi spi = new TestCommunicationSpi();
spi.setMessageQueueLimit(100);
cfg.setCommunicationSpi(spi);
cfg.setClientMode(gridName.contains("client"));
cfg.setCacheConfiguration(ccfg);
return cfg;
}
示例8: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
cfg.setClientMode(client);
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName(CACHE_NAME);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setBackups(1);
ccfg.setRebalanceMode(ASYNC);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
示例9: 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(CacheMode.REPLICATED);
cc.setWriteSynchronizationMode(FULL_SYNC);
c.setCacheConfiguration(cc);
TestCommunicationSpi commSpi = new TestCommunicationSpi(igniteInstanceName.equals(NO_COMMIT));
c.setCommunicationSpi(commSpi);
commSpis.add(commSpi);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
return c;
}
示例10: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
CommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
DiscoverySpi discoSpi = new TcpDiscoverySpi();
cfg.setDiscoverySpi(discoSpi);
cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
return cfg;
}
示例11: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
if (testSpi)
cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
if (connectionsPerNode != null)
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setConnectionsPerNode(connectionsPerNode);
cfg.setClientMode(client);
if (strLog != null) {
cfg.setGridLogger(strLog);
strLog = null;
}
return cfg;
}
示例12: 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);
cfg.setCommunicationSpi(new TestRecordingCommunicationSpi());
boolean client = "client".equals(igniteInstanceName);
cfg.setClientMode(client);
if (!client) {
CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
if (nearCacheEnabled())
ccfg.setNearConfiguration(new NearCacheConfiguration());
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setBackups(2);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(ccfg);
}
return cfg;
}
示例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(client);
TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
return cfg;
}
示例14: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration cacheCfg = cacheConfiguration(CACHE_NAME);
TestTpcCommunicationSpi commSpi = new TestTpcCommunicationSpi();
commSpi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
commSpi.setTcpNoDelay(true);
if (igniteInstanceName.endsWith(String.valueOf(CLN_GRD)))
cfg.setClientMode(true);
cacheCfg.setRebalanceMode(SYNC);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cacheCfg.setBackups(1);
cfg.setCommunicationSpi(commSpi);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(finder).setForceServerMode(true));
cfg.setCacheConfiguration(cacheCfg);
return cfg;
}
示例15: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setPeerClassLoadingEnabled(true);
CacheConfiguration cacheCfg = defaultCacheConfiguration();
cacheCfg.setCacheMode(REPLICATED);
cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
cfg.setCacheConfiguration(cacheCfg);
MessageCountingCommunicationSpi commSpi = new MessageCountingCommunicationSpi();
commSpis.put(igniteInstanceName, commSpi);
cfg.setCommunicationSpi(commSpi);
return cfg;
}