Search in sources :

Example 1 with OdbcConfiguration

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

the class JdbcThinAbstractSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setOdbcConfiguration(new OdbcConfiguration());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) OdbcConfiguration(org.apache.ignite.configuration.OdbcConfiguration)

Example 2 with OdbcConfiguration

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

the class OdbcConfigurationValidationSelfTest method testConnectionParams.

/**
 * Test connection parameters: sendBufferSize, receiveBufferSize, connectionTimeout.
 *
 * @throws Exception If failed.
 */
@Test
public void testConnectionParams() throws Exception {
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketSendBufferSize(4 * 1024), true);
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketReceiveBufferSize(4 * 1024), true);
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketSendBufferSize(-64 * 1024), false);
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketReceiveBufferSize(-64 * 1024), false);
}
Also used : OdbcConfiguration(org.apache.ignite.configuration.OdbcConfiguration) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 3 with OdbcConfiguration

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

the class ClientConnectorConfigurationValidationSelfTest method testIgnoreOdbcAndSqlWhenClientSet.

/**
 * Test SQL connector conversion.
 *
 * @throws Exception If failed.
 */
@Test
public void testIgnoreOdbcAndSqlWhenClientSet() throws Exception {
    int cliPort = ClientConnectorConfiguration.DFLT_PORT - 1;
    int sqlPort = ClientConnectorConfiguration.DFLT_PORT - 2;
    int odbcPort = ClientConnectorConfiguration.DFLT_PORT - 3;
    IgniteConfiguration cfg = baseConfiguration();
    cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().setPort(cliPort));
    cfg.setSqlConnectorConfiguration(new SqlConnectorConfiguration().setPort(sqlPort));
    cfg.setOdbcConfiguration(new OdbcConfiguration().setEndpointAddress("127.0.0.1:" + odbcPort));
    Ignition.start(cfg);
    checkJdbc(null, cliPort);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ClientConnectorConfiguration(org.apache.ignite.configuration.ClientConnectorConfiguration) OdbcConfiguration(org.apache.ignite.configuration.OdbcConfiguration) SqlConnectorConfiguration(org.apache.ignite.configuration.SqlConnectorConfiguration) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 4 with OdbcConfiguration

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

the class ClientConnectorConfigurationValidationSelfTest method testIgnoreOdbcWhenSqlSet.

/**
 * Test SQL connector conversion.
 *
 * @throws Exception If failed.
 */
@Test
public void testIgnoreOdbcWhenSqlSet() throws Exception {
    int port = ClientConnectorConfiguration.DFLT_PORT - 1;
    IgniteConfiguration cfg = baseConfiguration();
    cfg.setSqlConnectorConfiguration(new SqlConnectorConfiguration().setPort(port));
    cfg.setOdbcConfiguration(new OdbcConfiguration().setEndpointAddress("127.0.0.1:" + (port - 1)));
    Ignition.start(cfg);
    checkJdbc(null, port);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) OdbcConfiguration(org.apache.ignite.configuration.OdbcConfiguration) SqlConnectorConfiguration(org.apache.ignite.configuration.SqlConnectorConfiguration) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 5 with OdbcConfiguration

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

the class SqlListenerProcessorValidationSelfTest method testConnectionParams.

/**
     * Test connection parameters: sendBufferSize, receiveBufferSize, connectionTimeout.
     *
     * @throws Exception If failed.
     */
public void testConnectionParams() throws Exception {
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketSendBufferSize(4 * 1024), true);
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketReceiveBufferSize(4 * 1024), true);
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketSendBufferSize(-64 * 1024), false);
    check(new OdbcConfiguration().setEndpointAddress("127.0.0.1:9998..10000").setSocketReceiveBufferSize(-64 * 1024), false);
}
Also used : OdbcConfiguration(org.apache.ignite.configuration.OdbcConfiguration)

Aggregations

OdbcConfiguration (org.apache.ignite.configuration.OdbcConfiguration)9 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)6 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)5 Test (org.junit.Test)5 ClientConnectorConfiguration (org.apache.ignite.configuration.ClientConnectorConfiguration)3 SqlConnectorConfiguration (org.apache.ignite.configuration.SqlConnectorConfiguration)3 HostAndPortRange (org.apache.ignite.internal.util.HostAndPortRange)2 InetAddress (java.net.InetAddress)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 GridNioAsyncNotifyFilter (org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter)1 GridNioCodecFilter (org.apache.ignite.internal.util.nio.GridNioCodecFilter)1 GridNioFilter (org.apache.ignite.internal.util.nio.GridNioFilter)1 GridNioSession (org.apache.ignite.internal.util.nio.GridNioSession)1 IgniteThreadPoolExecutor (org.apache.ignite.thread.IgniteThreadPoolExecutor)1 Nullable (org.jetbrains.annotations.Nullable)1