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

The following examples show how to use org.apache.ignite.configuration.IgniteConfiguration#setIncludeProperties() . 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: GridAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * Optimizes configuration to achieve better test performance.
 *
 * @param cfg Configuration.
 * @return Optimized configuration (by modifying passed in one).
 * @throws IgniteCheckedException On error.
 */
protected IgniteConfiguration optimize(IgniteConfiguration cfg) throws IgniteCheckedException {
    if (cfg.getLocalHost() == null) {
        if (cfg.getDiscoverySpi() instanceof TcpDiscoverySpi) {
            cfg.setLocalHost("127.0.0.1");

            if (((TcpDiscoverySpi)cfg.getDiscoverySpi()).getJoinTimeout() == 0)
                ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setJoinTimeout(10000);
        }
        else
            cfg.setLocalHost(getTestResources().getLocalHost());
    }

    // Do not add redundant data if it is not needed.
    if (cfg.getIncludeProperties() == null)
        cfg.setIncludeProperties();

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

    if (binaryMarshallerEnabled)
        cfg.setMarshaller(new BinaryMarshaller());

    cfg.setIncludeProperties(PREFER_IPV4);
    cfg.setDeploymentMode(mode);
    cfg.setPeerClassLoadingEnabled(p2pEnabled);

    if (secEnabled)
        cfg.setPluginProviders(new TestReconnectSecurityPluginProvider());

    return cfg;
}
 
Example 3
Source File: GridCacheNearReaderPreloadSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * Create configuration for data node.
 *
 * @param ipFinder IP finder.
 * @param igniteInstanceName Ignite instance name.
 * @return Configuration for data node.
 * @throws IgniteCheckedException If failed.
 */
private IgniteConfiguration dataNode(TcpDiscoveryIpFinder ipFinder, String igniteInstanceName)
    throws Exception {
    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    ccfg.setName(CACHE_NAME);
    ccfg.setCacheMode(PARTITIONED);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    ccfg.setNearConfiguration(new NearCacheConfiguration());
    ccfg.setWriteSynchronizationMode(FULL_SYNC);
    ccfg.setBackups(1);

    IgniteConfiguration cfg = getConfiguration(igniteInstanceName);

    TcpDiscoverySpi spi = new TcpDiscoverySpi();

    spi.setIpFinder(ipFinder);

    cfg.setLocalHost("127.0.0.1");
    cfg.setDiscoverySpi(spi);
    cfg.setCacheConfiguration(ccfg);
    cfg.setIncludeProperties();
    cfg.setConnectorConfiguration(null);

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

        c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        c.setIncludeProperties();
        c.setDeploymentMode(DeploymentMode.SHARED);
        c.setNetworkTimeout(10000);
        c.setConnectorConfiguration(null);

//        c.setPeerClassLoadingLocalClassPathExclude(GridCachePreloadLifecycleAbstractTest.class.getName(),
//            MyValue.class.getName());

        c.setPublicThreadPoolSize(10);
        c.setSystemThreadPoolSize(10);
        c.setPeerClassLoadingThreadPoolSize(3);

        c.setLifecycleBeans(lifecycleBean);

        return c;
    }
 
Example 5
Source File: NotStringSystemPropertyTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration optimize(IgniteConfiguration cfg) throws IgniteCheckedException {
    IgniteConfiguration oCfg = super.optimize(cfg);

    oCfg.setIncludeProperties(null);

    return cfg;
}
 
Example 6
Source File: GridNodeVisorAttributesSelfTest.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.setIncludeProperties(inclProps);

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

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(mode);
    cc.setEvictionPolicy(createPolicy(plcMax));
    cc.setOnheapCacheEnabled(true);
    cc.setWriteSynchronizationMode(syncCommit ? FULL_SYNC : FULL_ASYNC);
    cc.setAtomicityMode(TRANSACTIONAL);

    if (nearEnabled) {
        NearCacheConfiguration nearCfg = new NearCacheConfiguration();

        nearCfg.setNearEvictionPolicy(createNearPolicy(nearMax));

        cc.setNearConfiguration(nearCfg);
    }
    else
        cc.setNearConfiguration(null);

    if (mode == PARTITIONED)
        cc.setBackups(1);

    if (filter != null)
        cc.setEvictionFilter(filter);

    c.setCacheConfiguration(cc);

    c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);

    c.setIncludeProperties();

    return c;
}
 
Example 8
Source File: ClusterMetricsSelfTest.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.setCacheConfiguration();
    cfg.setIncludeProperties();
    cfg.setIncludeEventTypes(EventType.EVTS_ALL);

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

    cfg.setPeerClassLoadingEnabled(false);

    cfg.setIncludeProperties();

    if (useCache) {
        CacheConfiguration cc = defaultCacheConfiguration();

        cc.setCacheMode(mode);
        cc.setAtomicityMode(getCacheAtomicityMode());

        if (nearEnabled) {
            NearCacheConfiguration nearCfg = new NearCacheConfiguration();

            cc.setNearConfiguration(nearCfg);
        }

        cc.setWriteSynchronizationMode(FULL_SYNC);

        if (store != null) {
            cc.setCacheStoreFactory(new IgniteReflectionFactory<CacheStore>(TestStore.class));
            cc.setReadThrough(true);
            cc.setWriteThrough(true);
        }

        cfg.setCacheConfiguration(cc);

        if (persistenceEnabled())
            cfg.setDataStorageConfiguration(new DataStorageConfiguration()
                .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
                        .setPersistenceEnabled(true))
                .setWalMode(WALMode.LOG_ONLY));
    }
    else {
        cfg.setCacheConfiguration();

        cfg.setClientMode(true);
    }

    cfg.setIncludeEventTypes(EventType.EVTS_ALL);

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

    cfg.setIncludeProperties();

    cfg.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);

    cfg.setConnectorConfiguration(null);

    cfg.setPeerClassLoadingEnabled(true);

    if (useCache) {
        CacheConfiguration cc = defaultCacheConfiguration();

        cc.setCacheMode(PARTITIONED);

        cc.setNearConfiguration(null);
        cc.setWriteSynchronizationMode(FULL_SYNC);

        cc.setBackups(1);

        cfg.setCacheSanityCheckEnabled(false);
        cfg.setCacheConfiguration(cc);
    }
    else
        cfg.setCacheConfiguration();

    return cfg;
}