本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setEventStorageSpi方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setEventStorageSpi方法的具体用法?Java IgniteConfiguration.setEventStorageSpi怎么用?Java IgniteConfiguration.setEventStorageSpi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setEventStorageSpi方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkLifecycleBeans
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @param igniteInstanceName Ignite instance name.
* @throws Exception If test failed.
*/
private void checkLifecycleBeans(@Nullable String igniteInstanceName) throws Exception {
TestLifecycleBean bean1 = new TestLifecycleBean();
TestLifecycleBean bean2 = new TestLifecycleBean();
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setLifecycleBeans(bean1, bean2);
cfg.setIgniteInstanceName(igniteInstanceName);
cfg.setEventStorageSpi(new MemoryEventStorageSpi());
cfg.setConnectorConfiguration(null);
try (Ignite g = IgniteSpring.start(cfg, new GenericApplicationContext())) {
bean1.checkState(igniteInstanceName, true);
bean2.checkState(igniteInstanceName, true);
}
bean1.checkState(igniteInstanceName, false);
bean2.checkState(igniteInstanceName, false);
checkLifecycleBean(bean1, igniteInstanceName);
checkLifecycleBean(bean2, igniteInstanceName);
}
示例2: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setEventStorageSpi(new GridTestRuntimeExceptionSpi());
cfg.setDeploymentSpi(new GridTestCheckedExceptionSpi());
// Disable cache since it can deploy some classes during start process.
cfg.setCacheConfiguration();
return cfg;
}
示例3: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
MemoryEventStorageSpi eventSpi = new MemoryEventStorageSpi();
eventSpi.setExpireCount(50);
cfg.setEventStorageSpi(eventSpi);
return cfg;
}
示例4: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(final String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setEventStorageSpi(new NoopEventStorageSpi());
return cfg;
}
示例5: initializeDefaultSpi
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Initialize default SPI implementations.
*
* @param cfg Ignite configuration.
*/
private void initializeDefaultSpi(IgniteConfiguration cfg) {
if (cfg.getDiscoverySpi() == null)
cfg.setDiscoverySpi(new TcpDiscoverySpi());
if (cfg.getDiscoverySpi() instanceof TcpDiscoverySpi) {
TcpDiscoverySpi tcpDisco = (TcpDiscoverySpi)cfg.getDiscoverySpi();
if (tcpDisco.getIpFinder() == null)
tcpDisco.setIpFinder(new TcpDiscoveryMulticastIpFinder());
}
if (cfg.getCommunicationSpi() == null)
cfg.setCommunicationSpi(new TcpCommunicationSpi());
if (cfg.getDeploymentSpi() == null)
cfg.setDeploymentSpi(new LocalDeploymentSpi());
if (cfg.getEventStorageSpi() == null)
cfg.setEventStorageSpi(new NoopEventStorageSpi());
if (cfg.getCheckpointSpi() == null)
cfg.setCheckpointSpi(new NoopCheckpointSpi());
if (cfg.getCollisionSpi() == null)
cfg.setCollisionSpi(new NoopCollisionSpi());
if (cfg.getFailoverSpi() == null)
cfg.setFailoverSpi(new AlwaysFailoverSpi());
if (cfg.getLoadBalancingSpi() == null)
cfg.setLoadBalancingSpi(new RoundRobinLoadBalancingSpi());
else {
Collection<LoadBalancingSpi> spis = new ArrayList<>();
boolean dfltLoadBalancingSpi = false;
for (LoadBalancingSpi spi : cfg.getLoadBalancingSpi()) {
spis.add(spi);
if (!dfltLoadBalancingSpi && spi instanceof RoundRobinLoadBalancingSpi)
dfltLoadBalancingSpi = true;
}
// Add default load balancing SPI for internal tasks.
if (!dfltLoadBalancingSpi)
spis.add(new RoundRobinLoadBalancingSpi());
cfg.setLoadBalancingSpi(spis.toArray(new LoadBalancingSpi[spis.size()]));
}
if (cfg.getIndexingSpi() == null)
cfg.setIndexingSpi(new NoopIndexingSpi());
}
示例6: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
TcpDiscoverySpi disco = new TcpDiscoverySpi().setForceServerMode(true);
disco.setIpFinder(ipFinder);
if (isDebug())
disco.setAckTimeout(Integer.MAX_VALUE);
MemoryEventStorageSpi evtSpi = new MemoryEventStorageSpi();
evtSpi.setExpireCount(100);
cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
cfg.setEventStorageSpi(evtSpi);
cfg.setDiscoverySpi(disco);
cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName));
return cfg;
}
示例7: 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(ipFinder);
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
cfg.setClientMode(client);
MemoryEventStorageSpi storeSpi = new MemoryEventStorageSpi();
storeSpi.setExpireCount(100);
cfg.setEventStorageSpi(storeSpi);
return cfg;
}
示例8: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setSystemThreadPoolSize(SYSTEM_POOL_SIZE);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1);
cfg.setClientMode(client);
MemoryEventStorageSpi storeSpi = new MemoryEventStorageSpi();
storeSpi.setExpireCount(100);
cfg.setEventStorageSpi(storeSpi);
return cfg;
}
示例9: 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(ipFinder);
cfg.setClientMode(client);
MemoryEventStorageSpi storeSpi = new MemoryEventStorageSpi();
storeSpi.setExpireCount(1000);
cfg.setEventStorageSpi(storeSpi);
return cfg;
}
示例10: 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()).setForceServerMode(true);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
TestCommunicationSpi commSpi = new TestCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
commSpi.setIdleConnectionTimeout(100);
cfg.setCommunicationSpi(commSpi);
MemoryEventStorageSpi evtSpi = new MemoryEventStorageSpi();
evtSpi.setExpireCount(50);
cfg.setEventStorageSpi(evtSpi);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setCacheMode(cacheMode());
ccfg.setAtomicityMode(atomicityMode());
ccfg.setBackups(backups);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setNearConfiguration(nearCacheConfiguration());
cfg.setCacheConfiguration(ccfg);
cfg.setClientMode(client);
return cfg;
}
示例11: igniteConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Configure node.
* @param basePort Base port.
* @param gridIdx Ignite instance name index.
* @param client If {@code true} then start client node.
* @return IgniteConfiguration
*/
private static IgniteConfiguration igniteConfiguration(int basePort, int gridIdx, boolean client) {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName((client ? "demo-client-" : "demo-server-" ) + gridIdx);
cfg.setLocalHost("127.0.0.1");
cfg.setEventStorageSpi(new MemoryEventStorageSpi());
int[] evts = new int[EVTS_DISCOVERY.length + VISOR_TASK_EVTS.length];
System.arraycopy(EVTS_DISCOVERY, 0, evts, 0, EVTS_DISCOVERY.length);
System.arraycopy(VISOR_TASK_EVTS, 0, evts, EVTS_DISCOVERY.length, VISOR_TASK_EVTS.length);
cfg.setIncludeEventTypes(evts);
cfg.getConnectorConfiguration().setPort(basePort);
System.setProperty(IGNITE_JETTY_PORT, String.valueOf(basePort + 10));
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
int discoPort = basePort + 20;
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:" + discoPort + ".." + (discoPort + NODE_CNT - 1)));
// Configure discovery SPI.
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setLocalPort(discoPort);
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
commSpi.setMessageQueueLimit(10);
int commPort = basePort + 30;
commSpi.setLocalPort(commPort);
cfg.setCommunicationSpi(commSpi);
cfg.setGridLogger(new Slf4jLogger(log));
cfg.setMetricsLogFrequency(0);
DataRegionConfiguration dataRegCfg = new DataRegionConfiguration();
dataRegCfg.setName("demo");
dataRegCfg.setMetricsEnabled(true);
dataRegCfg.setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
DataStorageConfiguration dataStorageCfg = new DataStorageConfiguration();
dataStorageCfg.setDefaultDataRegionConfiguration(dataRegCfg);
dataStorageCfg.setSystemRegionMaxSize(DFLT_DATA_REGION_INITIAL_SIZE);
cfg.setDataStorageConfiguration(dataStorageCfg);
if (client)
cfg.setClientMode(true);
return cfg;
}