本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setSqlConnectorConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setSqlConnectorConfiguration方法的具体用法?Java IgniteConfiguration.setSqlConnectorConfiguration怎么用?Java IgniteConfiguration.setSqlConnectorConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setSqlConnectorConfiguration方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIgnoreOdbcAndSqlWhenClientSet
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Test SQL connector conversion.
*
* @throws Exception If failed.
*/
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);
}
示例2: testIgnoreSqlWhenClientSet
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Test SQL connector conversion.
*
* @throws Exception If failed.
*/
public void testIgnoreSqlWhenClientSet() throws Exception {
int cliPort = ClientConnectorConfiguration.DFLT_PORT - 1;
int sqlPort = ClientConnectorConfiguration.DFLT_PORT - 2;
IgniteConfiguration cfg = baseConfiguration();
cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().setPort(cliPort));
cfg.setSqlConnectorConfiguration(new SqlConnectorConfiguration().setPort(sqlPort));
Ignition.start(cfg);
checkJdbc(null, cliPort);
}
示例3: check
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Perform check.
*
* @param sqlCfg SQL configuration.
* @param success Success flag. * @throws Exception If failed.
*/
@SuppressWarnings({"ThrowableResultOfMethodCallIgnored", "unchecked"})
private void check(SqlConnectorConfiguration sqlCfg, boolean success) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration();
cfg.setIgniteInstanceName(SqlConnectorConfigurationValidationSelfTest.class.getName() + "-" +
NODE_IDX_GEN.incrementAndGet());
cfg.setLocalHost("127.0.0.1");
cfg.setSqlConnectorConfiguration(sqlCfg);
cfg.setMarshaller(new BinaryMarshaller());
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(spi);
CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME)
.setIndexedTypes(SqlConnectorKey.class, SqlConnectorValue.class);
cfg.setCacheConfiguration(ccfg);
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);
}
}
示例4: testSqlConnectorConversion
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Test SQL connector conversion.
*
* @throws Exception If failed.
*/
public void testSqlConnectorConversion() throws Exception {
int port = ClientConnectorConfiguration.DFLT_PORT - 1;
IgniteConfiguration cfg = baseConfiguration();
cfg.setSqlConnectorConfiguration(new SqlConnectorConfiguration().setPort(port));
Ignition.start(cfg);
checkJdbc(null, port);
}
示例5: testIgnoreOdbcWhenSqlSet
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Test SQL connector conversion.
*
* @throws Exception If failed.
*/
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);
}