Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setOdbcConfiguration()
The following examples show how to use
org.apache.ignite.configuration.IgniteConfiguration#setOdbcConfiguration() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientConnectorConfigurationValidationSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** * 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); }
Example 2
Source File: ClientConnectorConfigurationValidationSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** * 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); }
Example 3
Source File: ClientConnectorConfigurationValidationSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** * Test SQL connector conversion. * * @throws Exception If failed. */ @Test public void testIgnoreOdbcWhenClientSet() throws Exception { int cliPort = ClientConnectorConfiguration.DFLT_PORT - 1; int odbcPort = ClientConnectorConfiguration.DFLT_PORT - 2; IgniteConfiguration cfg = baseConfiguration(); cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().setPort(cliPort)); cfg.setOdbcConfiguration(new OdbcConfiguration().setEndpointAddress("127.0.0.1:" + odbcPort)); Ignition.start(cfg); checkJdbc(null, cliPort); }
Example 4
Source File: OdbcConfigurationValidationSelfTest.java From ignite with Apache License 2.0 | 5 votes |
/** * Perform check. * * @param odbcCfg ODBC configuration. * @param success Success flag. * @throws Exception If failed. */ private void check(OdbcConfiguration odbcCfg, boolean success) throws Exception { final IgniteConfiguration cfg = super.getConfiguration(); cfg.setIgniteInstanceName(OdbcConfigurationValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet()); cfg.setLocalHost("127.0.0.1"); cfg.setOdbcConfiguration(odbcCfg); cfg.setMarshaller(new BinaryMarshaller()); TcpDiscoverySpi spi = new TcpDiscoverySpi(); spi.setIpFinder(new TcpDiscoveryVmIpFinder(true)); cfg.setDiscoverySpi(spi); if (success) startGrid(cfg.getIgniteInstanceName(), cfg); else { GridTestUtils.assertThrows(log, new Callable<Void>() { @Override public Void call() throws Exception { startGrid(cfg.getIgniteInstanceName(), cfg); return null; } }, IgniteException.class, null); } }
Example 5
Source File: ClientConnectorConfigurationValidationSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** * Test ODBC connector conversion. * * @throws Exception If failed. */ @Test public void testOdbcConnectorConversion() throws Exception { int port = ClientConnectorConfiguration.DFLT_PORT - 1; IgniteConfiguration cfg = baseConfiguration(); cfg.setOdbcConfiguration(new OdbcConfiguration().setEndpointAddress("127.0.0.1:" + port)); Ignition.start(cfg); checkJdbc(null, port); }