本文整理了Java中org.apache.ignite.Ignition.getOrStart()
方法的一些代码示例,展示了Ignition.getOrStart()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ignition.getOrStart()
方法的具体详情如下:
包路径:org.apache.ignite.Ignition
类名称:Ignition
方法名:getOrStart
[英]Gets or starts new grid instance if it hasn't been started yet.
[中]获取或启动尚未启动的新网格实例。
代码示例来源:origin: apache/ignite
/**
* Tests default Ignite instance
*/
@Test
public void testDefaultIgniteInstanceGetOrStart() throws Exception {
IgniteConfiguration cfg = getConfiguration(null);
try(Ignite ignite = Ignition.getOrStart(cfg)) {
try {
Ignition.start(cfg);
fail("Expected exception after grid started");
}
catch (IgniteException ignored) {
}
Ignite ignite2 = Ignition.getOrStart(cfg);
assertEquals("Must return same instance", ignite, ignite2);
}
}
代码示例来源:origin: apache/ignite
/**
* Tests named Ignite instance
*/
@Test
public void testNamedIgniteInstanceGetOrStart() throws Exception {
IgniteConfiguration cfg = getConfiguration("test");
try(Ignite ignite = Ignition.getOrStart(cfg)) {
try {
Ignition.start(cfg);
fail("Expected exception after grid started");
}
catch (IgniteException ignored) {
}
Ignite ignite2 = Ignition.getOrStart(cfg);
assertEquals("Must return same instance", ignite, ignite2);
}
}
}
代码示例来源:origin: marcosbarbero/spring-cloud-zuul-ratelimit
@Bean
@Qualifier("RateLimit")
public IgniteCache<String, GridBucketState> cache() {
ignite = Ignition.getOrStart(new IgniteConfiguration());
return ignite.getOrCreateCache("rateLimit");
}
代码示例来源:origin: marcosbarbero/spring-cloud-zuul-ratelimit
@Bean
@Qualifier("RateLimit")
public IgniteCache<String, GridBucketState> cache() {
ignite = Ignition.getOrStart(new IgniteConfiguration());
return ignite.getOrCreateCache("rateLimit");
}
内容来源于网络,如有侵权,请联系作者删除!