Search in sources :

Example 6 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class ClientAbstractSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setLocalHost(HOST);
    assert cfg.getConnectorConfiguration() == null;
    ConnectorConfiguration clientCfg = new ConnectorConfiguration();
    clientCfg.setPort(BINARY_PORT);
    if (useSsl()) {
        clientCfg.setSslEnabled(true);
        clientCfg.setSslContextFactory(sslContextFactory());
    }
    cfg.setConnectorConfiguration(clientCfg);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    cfg.setCacheConfiguration(cacheConfiguration(DEFAULT_CACHE_NAME), cacheConfiguration("replicated"), cacheConfiguration("partitioned"), cacheConfiguration(CACHE_NAME));
    clientCfg.setMessageInterceptor(new ConnectorMessageInterceptor() {

        /** {@inheritDoc} */
        @Override
        public Object onReceive(@Nullable Object obj) {
            if (obj != null)
                INTERCEPTED_OBJECTS.put(obj, obj);
            return overwriteIntercepted && obj instanceof String ? obj + INTERCEPTED_SUF : obj;
        }

        /** {@inheritDoc} */
        @Override
        public Object onSend(Object obj) {
            if (obj != null)
                INTERCEPTED_OBJECTS.put(obj, obj);
            return obj;
        }
    });
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorMessageInterceptor(org.apache.ignite.configuration.ConnectorMessageInterceptor) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 7 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class ClientPreferDirectSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    c.setDiscoverySpi(disco);
    c.setLocalHost(HOST);
    assert c.getConnectorConfiguration() == null;
    ConnectorConfiguration clientCfg = new ConnectorConfiguration();
    clientCfg.setPort(REST_TCP_PORT_BASE);
    c.setConnectorConfiguration(clientCfg);
    return c;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 8 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class RouterFactorySelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setDiscoverySpi(discoSpi);
    cfg.setIgniteInstanceName(igniteInstanceName);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 9 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class ClientFailedInitSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    assert cfg.getConnectorConfiguration() == null;
    cfg.setLocalHost(HOST);
    ConnectorConfiguration clientCfg = new ConnectorConfiguration();
    clientCfg.setPort(BINARY_PORT);
    clientCfg.setJettyPath(REST_JETTY_CFG);
    cfg.setConnectorConfiguration(clientCfg);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 10 with TcpDiscoverySpi

use of org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi in project ignite by apache.

the class JdbcComplexQuerySelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration("pers", AffinityKey.class, Person.class), cacheConfiguration("org", String.class, Organization.class));
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    cfg.setConnectorConfiguration(new ConnectorConfiguration());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) AffinityKey(org.apache.ignite.cache.affinity.AffinityKey) 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