Search in sources :

Example 1 with ConnectorConfiguration

use of org.apache.ignite.configuration.ConnectorConfiguration in project ignite by apache.

the class ClientTcpTaskExecutionAfterTopologyRestartSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setLocalHost("127.0.0.1");
    assert cfg.getConnectorConfiguration() == null;
    ConnectorConfiguration clientCfg = new ConnectorConfiguration();
    clientCfg.setPort(PORT);
    cfg.setConnectorConfiguration(clientCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration)

Example 2 with ConnectorConfiguration

use of org.apache.ignite.configuration.ConnectorConfiguration 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)

Example 3 with ConnectorConfiguration

use of org.apache.ignite.configuration.ConnectorConfiguration 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 4 with ConnectorConfiguration

use of org.apache.ignite.configuration.ConnectorConfiguration 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 5 with ConnectorConfiguration

use of org.apache.ignite.configuration.ConnectorConfiguration 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)

Aggregations

ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)48 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)44 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)36 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)10 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)4 AffinityKey (org.apache.ignite.cache.affinity.AffinityKey)2 GridSslContextFactory (org.apache.ignite.internal.client.ssl.GridSslContextFactory)2 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)2 IOException (java.io.IOException)1 SSLContext (javax.net.ssl.SSLContext)1 SSLException (javax.net.ssl.SSLException)1 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)1 QueryEntity (org.apache.ignite.cache.QueryEntity)1 QueryIndex (org.apache.ignite.cache.QueryIndex)1 LruEvictionPolicy (org.apache.ignite.cache.eviction.lru.LruEvictionPolicy)1 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)1 ConnectorMessageInterceptor (org.apache.ignite.configuration.ConnectorMessageInterceptor)1 MemoryConfiguration (org.apache.ignite.configuration.MemoryConfiguration)1 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)1 OdbcConfiguration (org.apache.ignite.configuration.OdbcConfiguration)1