Search in sources :

Example 21 with ConnectorConfiguration

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

the class JdbcMetadataSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    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) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 22 with ConnectorConfiguration

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

the class JdbcNoDefaultCacheTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setCacheConfiguration(cacheConfiguration(CACHE1_NAME), cacheConfiguration(CACHE2_NAME));
    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) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 23 with ConnectorConfiguration

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

the class IgniteKernal method registerExecutorMBeans.

/**
     * @param execSvc Public executor service.
     * @param sysExecSvc System executor service.
     * @param p2pExecSvc P2P executor service.
     * @param mgmtExecSvc Management executor service.
     * @param restExecSvc Query executor service.
     * @param schemaExecSvc Schema executor service.
     * @throws IgniteCheckedException If failed.
     */
private void registerExecutorMBeans(ExecutorService execSvc, ExecutorService sysExecSvc, ExecutorService p2pExecSvc, ExecutorService mgmtExecSvc, ExecutorService restExecSvc, ExecutorService qryExecSvc, ExecutorService schemaExecSvc) throws IgniteCheckedException {
    pubExecSvcMBean = registerExecutorMBean(execSvc, "GridExecutionExecutor");
    sysExecSvcMBean = registerExecutorMBean(sysExecSvc, "GridSystemExecutor");
    mgmtExecSvcMBean = registerExecutorMBean(mgmtExecSvc, "GridManagementExecutor");
    p2PExecSvcMBean = registerExecutorMBean(p2pExecSvc, "GridClassLoadingExecutor");
    qryExecSvcMBean = registerExecutorMBean(qryExecSvc, "GridQueryExecutor");
    schemaExecSvcMBean = registerExecutorMBean(schemaExecSvc, "GridSchemaExecutor");
    ConnectorConfiguration clientCfg = cfg.getConnectorConfiguration();
    if (clientCfg != null)
        restExecSvcMBean = registerExecutorMBean(restExecSvc, "GridRestExecutor");
}
Also used : ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration)

Example 24 with ConnectorConfiguration

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

the class GridTcpRestProtocol method start.

/** {@inheritDoc} */
@SuppressWarnings("BusyWait")
@Override
public void start(final GridRestProtocolHandler hnd) throws IgniteCheckedException {
    assert hnd != null;
    ConnectorConfiguration cfg = ctx.config().getConnectorConfiguration();
    assert cfg != null;
    lsnr = new GridTcpRestNioListener(log, this, hnd, ctx);
    GridNioParser parser = new GridTcpRestParser(false);
    try {
        host = resolveRestTcpHost(ctx.config());
        SSLContext sslCtx = null;
        if (cfg.isSslEnabled()) {
            Factory<SSLContext> igniteFactory = ctx.config().getSslContextFactory();
            Factory<SSLContext> factory = cfg.getSslFactory();
            // This factory deprecated and will be removed.
            GridSslContextFactory depFactory = cfg.getSslContextFactory();
            if (factory == null && depFactory == null && igniteFactory == null)
                // Thrown SSL exception instead of IgniteCheckedException for writing correct warning message into log.
                throw new SSLException("SSL is enabled, but SSL context factory is not specified.");
            if (factory != null)
                sslCtx = factory.create();
            else if (depFactory != null)
                sslCtx = depFactory.createSslContext();
            else
                sslCtx = igniteFactory.create();
        }
        int startPort = cfg.getPort();
        int portRange = cfg.getPortRange();
        int lastPort = portRange == 0 ? startPort : startPort + portRange - 1;
        for (int port0 = startPort; port0 <= lastPort; port0++) {
            if (startTcpServer(host, port0, lsnr, parser, sslCtx, cfg)) {
                port = port0;
                if (log.isInfoEnabled())
                    log.info(startInfo());
                return;
            }
        }
        U.warn(log, "Failed to start TCP binary REST server (possibly all ports in range are in use) " + "[firstPort=" + cfg.getPort() + ", lastPort=" + lastPort + ", host=" + host + ']');
    } catch (SSLException e) {
        U.warn(log, "Failed to start " + name() + " protocol on port " + port + ": " + e.getMessage(), "Failed to start " + name() + " protocol on port " + port + ". Check if SSL context factory is " + "properly configured.");
    } catch (IOException e) {
        U.warn(log, "Failed to start " + name() + " protocol on port " + port + ": " + e.getMessage(), "Failed to start " + name() + " protocol on port " + port + ". " + "Check restTcpHost configuration property.");
    }
}
Also used : GridSslContextFactory(org.apache.ignite.internal.client.ssl.GridSslContextFactory) GridNioParser(org.apache.ignite.internal.util.nio.GridNioParser) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) SSLContext(javax.net.ssl.SSLContext) IOException(java.io.IOException) SSLException(javax.net.ssl.SSLException)

Example 25 with ConnectorConfiguration

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

the class HadoopAbstractSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setHadoopConfiguration(hadoopConfiguration(igniteInstanceName));
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setSharedMemoryPort(-1);
    cfg.setCommunicationSpi(commSpi);
    TcpDiscoverySpi discoSpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    if (igfsEnabled())
        cfg.setFileSystemConfiguration(igfsConfiguration());
    if (restEnabled()) {
        ConnectorConfiguration clnCfg = new ConnectorConfiguration();
        clnCfg.setPort(restPort++);
        cfg.setConnectorConfiguration(clnCfg);
    }
    cfg.setLocalHost("127.0.0.1");
    cfg.setPeerClassLoadingEnabled(false);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ConnectorConfiguration(org.apache.ignite.configuration.ConnectorConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) 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