Search in sources :

Example 1 with TcpDiscoverySpi

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);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 2 with TcpDiscoverySpi

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();
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) Properties(java.util.Properties) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) Before(org.junit.Before)

Example 3 with TcpDiscoverySpi

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 4 with TcpDiscoverySpi

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;
}
Also used : CommunicationSpi(org.apache.ignite.spi.communication.CommunicationSpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) Log4JLogger(org.apache.ignite.logger.log4j.Log4JLogger) DiscoverySpi(org.apache.ignite.spi.discovery.DiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 5 with TcpDiscoverySpi

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)650 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)633 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)287 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)73 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)69 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)55 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)36 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)34 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)31 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)31 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)21 ArrayList (java.util.ArrayList)15 Ignite (org.apache.ignite.Ignite)13 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)11 MemoryConfiguration (org.apache.ignite.configuration.MemoryConfiguration)11 QueryEntity (org.apache.ignite.cache.QueryEntity)10 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)10 DiscoverySpi (org.apache.ignite.spi.discovery.DiscoverySpi)10 MemoryEventStorageSpi (org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)10 LruEvictionPolicy (org.apache.ignite.cache.eviction.lru.LruEvictionPolicy)9