Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setSqlConfiguration()

The following examples show how to use org.apache.ignite.configuration.IgniteConfiguration#setSqlConfiguration() . 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: IgniteSqlSkipReducerOnUpdateDmlSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@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;
}
 
Example 2
Source File: IgniteCacheLocalQueryDefaultTimeoutSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<Integer, String> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    ccfg.setIndexedTypes(Integer.class, String.class);
    ccfg.setCacheMode(LOCAL);

    cfg.setCacheConfiguration(ccfg);
    cfg.setSqlConfiguration(new SqlConfiguration().setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT));

    return cfg;
}
 
Example 3
Source File: IgniteCacheDistributedQueryDefaultTimeoutSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<Integer, String> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
    ccfg.setIndexedTypes(Integer.class, String.class);

    cfg.setCacheConfiguration(ccfg);
    cfg.setSqlConfiguration(new SqlConfiguration().setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT));

    return cfg;
}
 
Example 4
Source File: JdbcThinComplexDmlDdlCustomSchemaSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@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;
}
 
Example 5
Source File: JdbcMetadataSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@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;
}
 
Example 6
Source File: SqlQueryHistorySelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(ipFinder);

    cfg.setDiscoverySpi(disco);

    cfg.setCacheConfiguration(configureCache("A"), configureCache("B"));

    cfg.setSqlConfiguration(new SqlConfiguration().setSqlQueryHistorySize(QUERY_HISTORY_SIZE));

    return cfg;
}