Search in sources :

Example 91 with DataStorageConfiguration

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

the class IgniteWalRecoveryTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(cacheName);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setNodeFilter(new RemoteNodeFilter());
    ccfg.setIndexedTypes(Integer.class, IndexedObject.class);
    cfg.setCacheConfiguration(ccfg);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    dbCfg.setPageSize(4 * 1024);
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("dfltDataRegion");
    memPlcCfg.setInitialSize(1024 * 1024 * 1024);
    memPlcCfg.setMaxSize(1024 * 1024 * 1024);
    memPlcCfg.setPersistenceEnabled(true);
    dbCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    dbCfg.setWalRecordIteratorBufferSize(1024 * 1024);
    dbCfg.setWalHistorySize(2);
    if (logOnly)
        dbCfg.setWalMode(WALMode.LOG_ONLY);
    if (walSegmentSize != 0)
        dbCfg.setWalSegmentSize(walSegmentSize);
    cfg.setDataStorageConfiguration(dbCfg);
    cfg.setMarshaller(null);
    BinaryConfiguration binCfg = new BinaryConfiguration();
    binCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(binCfg);
    if (!getTestIgniteInstanceName(0).equals(gridName))
        cfg.setUserAttributes(F.asMap(HAS_CACHE, true));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 92 with DataStorageConfiguration

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

the class IgniteWalSerializerVersionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(100 * 1024 * 1024)));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 93 with DataStorageConfiguration

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

the class WalCompactionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(200 * 1024 * 1024)).setWalMode(WALMode.LOG_ONLY).setWalSegmentSize(WAL_SEGMENT_SIZE).setWalHistorySize(500).setWalCompactionEnabled(true));
    CacheConfiguration ccfg = new CacheConfiguration();
    ccfg.setName("cache");
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 16));
    ccfg.setBackups(0);
    cfg.setCacheConfiguration(ccfg);
    cfg.setConsistentId(name);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 94 with DataStorageConfiguration

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

the class IgniteBaselineAffinityTopologyActivationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (consId != null)
        cfg.setConsistentId(consId);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(10 * 1024 * 1024)).setWalMode(WALMode.LOG_ONLY));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 95 with DataStorageConfiguration

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

the class PagesWriteThrottleSmokeTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi) cfg.getDiscoverySpi();
    discoverySpi.setIpFinder(ipFinder);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(400 * 1024 * 1024).setCheckpointPageBufferSize(200 * 1000 * 1000).setName("dfltDataRegion").setMetricsEnabled(true).setPersistenceEnabled(true)).setWalMode(WALMode.BACKGROUND).setCheckpointFrequency(20_000).setWriteThrottlingEnabled(true).setCheckpointThreads(1).setFileIOFactory(new SlowCheckpointFileIOFactory());
    cfg.setDataStorageConfiguration(dbCfg);
    CacheConfiguration ccfg1 = new CacheConfiguration();
    ccfg1.setName(CACHE_NAME);
    ccfg1.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC);
    ccfg1.setAffinity(new RendezvousAffinityFunction(false, 64));
    cfg.setCacheConfiguration(ccfg1);
    cfg.setConsistentId(gridName);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)143 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)120 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)119 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)55 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)51 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)33 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)17 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)7 File (java.io.File)6 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)6 ArrayList (java.util.ArrayList)4 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)4 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)4 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)4 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)3 IgniteOutOfMemoryException (org.apache.ignite.internal.mem.IgniteOutOfMemoryException)3 IOException (java.io.IOException)2 LinkedHashMap (java.util.LinkedHashMap)2 QueryEntity (org.apache.ignite.cache.QueryEntity)2 QueryIndex (org.apache.ignite.cache.QueryIndex)2