use of org.apache.ignite.configuration.SqlConfiguration in project ignite by apache.
the class JdbcThinComplexDmlDdlCustomSchemaSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setSqlConfiguration(new SqlConfiguration().setSqlSchemas(SCHEMA_1, SCHEMA_2));
return cfg;
}
use of org.apache.ignite.configuration.SqlConfiguration in project ignite by apache.
the class JdbcMetadataSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
LinkedHashMap<String, Boolean> persFields = new LinkedHashMap<>();
persFields.put("name", true);
persFields.put("age", false);
cfg.setCacheConfiguration(cacheConfiguration("pers").setQueryEntities(Arrays.asList(new QueryEntityEx(new QueryEntity(AffinityKey.class.getName(), Person.class.getName()).addQueryField("name", String.class.getName(), null).addQueryField("age", Integer.class.getName(), null).addQueryField("orgId", Integer.class.getName(), null).setIndexes(Arrays.asList(new QueryIndex("orgId"), new QueryIndex().setFields(persFields)))).setNotNullFields(new HashSet<>(Arrays.asList("age", "name"))))), cacheConfiguration("org").setQueryEntities(Arrays.asList(new QueryEntity(AffinityKey.class, Organization.class))), cacheConfiguration("metaTest").setQueryEntities(Arrays.asList(new QueryEntity(AffinityKey.class, MetaTest.class))));
cfg.setConnectorConfiguration(new ConnectorConfiguration());
cfg.setSqlConfiguration(new SqlConfiguration().setSqlSchemas("PREDEFINED_SCHEMAS_1", "PREDEFINED_SCHEMAS_2"));
return cfg;
}
use of org.apache.ignite.configuration.SqlConfiguration in project ignite by apache.
the class IgniteCacheLocalQueryDefaultTimeoutSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
CacheConfiguration<Integer, String> ccfg = new CacheConfiguration<Integer, String>(DEFAULT_CACHE_NAME).setIndexedTypes(Integer.class, String.class).setCacheMode(LOCAL).setSqlFunctionClasses(TimedQueryHelper.class);
cfg.setCacheConfiguration(ccfg);
cfg.setSqlConfiguration(new SqlConfiguration().setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT));
return cfg;
}
use of org.apache.ignite.configuration.SqlConfiguration in project ignite by apache.
the class IgniteSqlSkipReducerOnUpdateDmlSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration c = super.getConfiguration(gridName);
List<CacheConfiguration> ccfgs = new ArrayList<>();
ccfgs.add(buildCacheConfiguration(CACHE_ORG));
ccfgs.add(buildCacheConfiguration(CACHE_PERSON));
ccfgs.add(buildCacheConfiguration(CACHE_POSITION));
c.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()]));
c.setSqlConfiguration(new SqlConfiguration().setLongQueryWarningTimeout(10000));
c.setIncludeEventTypes(EventType.EVTS_ALL);
return c;
}
use of org.apache.ignite.configuration.SqlConfiguration in project ignite by apache.
the class IgniteSqlSchemasDiffConfigurationsTest method testDiffSqlSchemasCfgProp.
/**
*/
@Test
public void testDiffSqlSchemasCfgProp() throws Exception {
startGrid(getConfiguration("ign1").setSqlConfiguration(new SqlConfiguration().setSqlSchemas(SCHEMA_NAME_1, SCHEMA_NAME_2)));
startGrid(getConfiguration("ign2").setSqlConfiguration(new SqlConfiguration().setSqlSchemas(SCHEMA_NAME_3, SCHEMA_NAME_4)));
List<List<String>> exp = Arrays.asList(Arrays.asList(SCHEMA_NAME_1, "cache_1"), Arrays.asList(SCHEMA_NAME_2, "cache_2"), Arrays.asList(SCHEMA_NAME_3, "cache_3"), Arrays.asList(SCHEMA_NAME_4, "cache_4"));
for (List<String> row : exp) grid("ign1").createCache(new CacheConfiguration<>(row.get(1)).setSqlSchema(row.get(0)));
List<List<?>> res = execSql("ign1", "SELECT SQL_SCHEMA, CACHE_NAME FROM " + t(QueryUtils.SCHEMA_SYS, "CACHES") + " WHERE CACHE_NAME LIKE 'cache%' ORDER BY SQL_SCHEMA");
Assert.assertEquals(exp, res);
}
Aggregations