use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class JdbcStreamingSelfTest method getConfiguration0.
/**
* @param gridName Grid name.
* @return Grid configuration used for starting the grid.
* @throws Exception If failed.
*/
private IgniteConfiguration getConfiguration0(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
CacheConfiguration<?, ?> cache = defaultCacheConfiguration();
cache.setCacheMode(PARTITIONED);
cache.setBackups(1);
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setIndexedTypes(Integer.class, Integer.class);
cfg.setCacheConfiguration(cache);
cfg.setLocalHost("127.0.0.1");
TcpDiscoverySpi disco = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500..47501"));
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
cfg.setConnectorConfiguration(new ConnectorConfiguration());
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class JdbcConnectionSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration(CUSTOM_CACHE_NAME));
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setDaemon(daemon);
cfg.setClientMode(client);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class RedisProtocolSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setLocalHost(HOST);
assert cfg.getConnectorConfiguration() == null;
ConnectorConfiguration redisCfg = new ConnectorConfiguration();
redisCfg.setHost(HOST);
redisCfg.setPort(PORT);
cfg.setConnectorConfiguration(redisCfg);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
CacheConfiguration ccfg = defaultCacheConfiguration();
ccfg.setStatisticsEnabled(true);
ccfg.setIndexedTypes(String.class, String.class);
cfg.setCacheConfiguration(ccfg);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class AbstractJdbcPojoQuerySelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
IgniteConfiguration cfg = super.getConfiguration(gridName);
CacheConfiguration<?, ?> cache = defaultCacheConfiguration();
cache.setWriteSynchronizationMode(FULL_SYNC);
cache.setAtomicityMode(TRANSACTIONAL);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setConnectorConfiguration(new ConnectorConfiguration());
QueryEntity queryEntity = new QueryEntity();
queryEntity.setKeyType("java.lang.String");
queryEntity.setValueType("org.apache.ignite.internal.JdbcTestObject");
queryEntity.addQueryField("id", "java.lang.Integer", null);
queryEntity.addQueryField("testObject", "org.apache.ignite.internal.JdbcTestObject2", null);
queryEntity.setIndexes(Collections.singletonList(new QueryIndex("id")));
cache.setQueryEntities(Collections.singletonList(queryEntity));
cfg.setCacheConfiguration(cache);
return cfg;
}
use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.
the class RestProcessorTest method cacheTestConfiguration.
/**
* @param cfg Initial configuration.
* @return Final configuration.
*/
@SuppressWarnings({ "unchecked" })
private IgniteConfiguration cacheTestConfiguration(IgniteConfiguration cfg) {
TcpDiscoverySpi disco = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setShared(true);
disco.setIpFinder(ipFinder);
cfg.setDiscoverySpi(disco);
assert cfg.getConnectorConfiguration() == null;
ConnectorConfiguration clientCfg = new ConnectorConfiguration();
// Ensure - no authentication.
clientCfg.setSecretKey(null);
cfg.setConnectorConfiguration(clientCfg);
cfg.setCacheConfiguration(defaultCacheConfiguration());
return cfg;
}
Aggregations