use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project camel by apache.
the class AbstractIgniteTest method buildComponent.
protected IgniteComponent buildComponent() {
IgniteConfiguration config = new IgniteConfiguration();
config.setGridName(UUID.randomUUID().toString());
config.setIncludeEventTypes(EventType.EVT_JOB_FINISHED, EventType.EVT_JOB_RESULTED);
config.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(LOCAL_IP_FINDER));
return IgniteComponent.fromConfiguration(config);
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project zeppelin by apache.
the class IgniteSqlInterpreterTest method setUp.
@Before
public void setUp() {
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singletonList(HOST));
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setDiscoverySpi(discoSpi);
cfg.setPeerClassLoadingEnabled(true);
cfg.setGridName("test");
ignite = Ignition.start(cfg);
Properties props = new Properties();
props.setProperty(IgniteSqlInterpreter.IGNITE_JDBC_URL, "jdbc:ignite:cfg://cache=person@default-ignite-jdbc.xml");
intp = new IgniteSqlInterpreter(props);
CacheConfiguration<Integer, Person> cacheConf = new CacheConfiguration<>();
cacheConf.setIndexedTypes(Integer.class, Person.class);
cacheConf.setName("person");
IgniteCache<Integer, Person> cache = ignite.createCache(cacheConf);
cache.put(1, new Person("sun", 100));
cache.put(2, new Person("moon", 50));
assertEquals("moon", cache.get(2).getName());
intp.open();
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class ComputeFailoverNodeStartup method configuration.
/**
* Create Ignite configuration with configured checkpoints.
*
* @return Ignite configuration.
* @throws IgniteException If configuration creation failed.
*/
public static IgniteConfiguration configuration() throws IgniteException {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setLocalHost("127.0.0.1");
cfg.setPeerClassLoadingEnabled(true);
// Configure checkpoint SPI.
SharedFsCheckpointSpi checkpointSpi = new SharedFsCheckpointSpi();
checkpointSpi.setDirectoryPaths(Collections.singletonList("work/checkpoint/sharedfs"));
cfg.setCheckpointSpi(checkpointSpi);
// Configure discovery SPI.
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class GridifySingleSplitLoadTest method getConfiguration.
/** {@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;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class ClientAbstractMultiThreadedSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
c.setLocalHost(HOST);
assert c.getConnectorConfiguration() == null;
ConnectorConfiguration clientCfg = new ConnectorConfiguration();
clientCfg.setPort(REST_TCP_PORT_BASE);
if (useSsl()) {
clientCfg.setSslEnabled(true);
clientCfg.setSslContextFactory(sslContextFactory());
}
c.setConnectorConfiguration(clientCfg);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
c.setDiscoverySpi(disco);
c.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(PARTITIONED_CACHE_NAME), cacheConfiguration(REPLICATED_CACHE_NAME), cacheConfiguration(PARTITIONED_ASYNC_BACKUP_CACHE_NAME), cacheConfiguration(REPLICATED_ASYNC_CACHE_NAME));
return c;
}
Aggregations