Search in sources :

Example 41 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgniteOptimisticTxSuspendResumeTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setClientMode(client);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 42 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgniteSystemCacheOnClientTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    if (igniteInstanceName.equals(getTestIgniteInstanceName(1)))
        cfg.setClientMode(true);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 43 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class GridCacheSwapPreloadSelfTest method getConfiguration.

/**
 * {@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.setNetworkTimeout(2000);
    CacheConfiguration cacheCfg = defaultCacheConfiguration();
    cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
    cacheCfg.setCacheMode(cacheMode);
    cacheCfg.setRebalanceMode(SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    if (cacheMode == PARTITIONED)
        cacheCfg.setBackups(1);
    cfg.setCacheConfiguration(cacheCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 44 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgfsBackupFailoverSelfTest method startGridWithIgfs.

/**
 * Start grid with IGFS.
 *
 * @param igniteInstanceName Ignite instance name.
 * @param mode IGFS mode.
 * @param secondaryFs Secondary file system (optional).
 * @return Started grid instance.
 * @throws Exception If failed.
 */
protected Ignite startGridWithIgfs(String igniteInstanceName, IgfsMode mode, @Nullable IgfsSecondaryFileSystem secondaryFs) throws Exception {
    final FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
    igfsCfg.setName("igfs");
    igfsCfg.setBlockSize(igfsBlockSize);
    igfsCfg.setDefaultMode(mode);
    igfsCfg.setSecondaryFileSystem(secondaryFs);
    CacheConfiguration<?, ?> dataCacheCfg = defaultCacheConfiguration();
    dataCacheCfg.setCacheMode(PARTITIONED);
    dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(affGrpSize));
    dataCacheCfg.setBackups(numBackups);
    dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
    CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
    metaCacheCfg.setCacheMode(REPLICATED);
    metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
    igfsCfg.setMetaCacheConfiguration(metaCacheCfg);
    igfsCfg.setDataCacheConfiguration(dataCacheCfg);
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(igniteInstanceName);
    cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
    cfg.setFileSystemConfiguration(igfsCfg);
    cfg.setLocalHost("127.0.0.1");
    return startGrid(igniteInstanceName, cfg);
}
Also used : IgfsGroupDataBlocksKeyMapper(org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 45 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class CacheRandomOperationsMultithreadedTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    cfg.setClientMode(client);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2118 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)686 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)404 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)385 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)363 Ignite (org.apache.ignite.Ignite)194 Test (org.junit.Test)182 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)161 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)127 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)123 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)105 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)98 IgniteEx (org.apache.ignite.internal.IgniteEx)95 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)89 IgniteException (org.apache.ignite.IgniteException)78 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)75 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)72 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)68 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)65 ArrayList (java.util.ArrayList)55