Search in sources :

Example 41 with DataStorageConfiguration

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

the class IgniteDataStorageMetricsSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setConsistentId(gridName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(10 * 1024 * 1024).setPersistenceEnabled(true).setMetricsEnabled(true).setName("dflt-plc")).setDataRegionConfigurations(new DataRegionConfiguration().setMaxSize(10 * 1024 * 1024).setPersistenceEnabled(false).setMetricsEnabled(true).setName("no-persistence")).setWalMode(WALMode.LOG_ONLY).setPageSize(4 * 1024).setMetricsEnabled(true);
    cfg.setDataStorageConfiguration(memCfg);
    cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    cfg.setCacheConfiguration(cacheConfiguration(GROUP1, "cache", PARTITIONED, ATOMIC, 1, null), cacheConfiguration(null, "cache-np", PARTITIONED, ATOMIC, 1, "no-persistence"));
    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) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 42 with DataStorageConfiguration

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

the class IgnitePdsBinaryMetadataOnClusterRestartTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    if (customWorkSubDir != null)
        cfg.setWorkDirectory(Paths.get(U.defaultWorkDirectory(), customWorkSubDir).toString());
    cfg.setClientMode(clientMode);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setWalMode(WALMode.LOG_ONLY).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(100 * 1024 * 1024)));
    BinaryConfiguration bCfg = new BinaryConfiguration();
    BinaryTypeConfiguration binaryEnumCfg = new BinaryTypeConfiguration(EnumType.class.getName());
    binaryEnumCfg.setEnum(true);
    binaryEnumCfg.setEnumValues(F.asMap(EnumType.ENUM_VAL_0.name(), EnumType.ENUM_VAL_0.ordinal(), EnumType.ENUM_VAL_1.name(), EnumType.ENUM_VAL_1.ordinal()));
    bCfg.setTypeConfigurations(Arrays.asList(binaryEnumCfg));
    cfg.setBinaryConfiguration(bCfg);
    CacheKeyConfiguration dynamicMetaKeyCfg = new CacheKeyConfiguration(DYNAMIC_TYPE_NAME, DYNAMIC_INT_FIELD_NAME);
    cfg.setCacheKeyConfiguration(dynamicMetaKeyCfg);
    cfg.setCacheConfiguration(new CacheConfiguration().setName(CACHE_NAME).setAffinity(new RendezvousAffinityFunction()).setCacheMode(CacheMode.REPLICATED));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) CacheKeyConfiguration(org.apache.ignite.cache.CacheKeyConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryTypeConfiguration(org.apache.ignite.binary.BinaryTypeConfiguration) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 43 with DataStorageConfiguration

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

the class IgniteChangeGlobalStateAbstractTest method getConfiguration.

/**
 * @param gridName Grid name.
 */
@Override
protected IgniteConfiguration getConfiguration(final String gridName) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration pCfg = new DataStorageConfiguration();
    pCfg.setStoragePath(testName() + "/db");
    pCfg.setWalArchivePath(testName() + "/db/wal/archive");
    pCfg.setWalPath(testName() + "/db/wal");
    pCfg.setPageSize(1024);
    pCfg.setConcurrencyLevel(64);
    pCfg.setWalMode(WALMode.LOG_ONLY);
    pCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024).setPersistenceEnabled(true));
    cfg.setDataStorageConfiguration(pCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 44 with DataStorageConfiguration

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

the class IgniteCheckpointDirtyPagesForLowLoadTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    List<CacheConfiguration> ccfgs = new ArrayList<>();
    for (int g = 0; g < GROUPS; g++) {
        for (int i = 0; i < CACHES_IN_GRP; i++) {
            CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>().setName("dummyCache" + i + "." + g).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setGroupName("dummyGroup" + g).setAffinity(new RendezvousAffinityFunction(false, PARTS));
            ccfgs.add(ccfg);
        }
    }
    cfg.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()]));
    DataStorageConfiguration dsCfg = new DataStorageConfiguration();
    // smaller page to reduce overhead to short values
    dsCfg.setPageSize(1024);
    dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true));
    dsCfg.setCheckpointFrequency(500);
    dsCfg.setWalMode(WALMode.LOG_ONLY);
    dsCfg.setWalHistorySize(1);
    cfg.setDataStorageConfiguration(dsCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) ArrayList(java.util.ArrayList) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 45 with DataStorageConfiguration

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

the class IgniteDbAbstractTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    if (client)
        cfg.setClientMode(true);
    dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
    if (isLargePage())
        dbCfg.setPageSize(16 * 1024);
    else
        dbCfg.setPageSize(4 * 1024);
    dbCfg.setWalMode(WALMode.LOG_ONLY);
    dbCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setName("default"));
    configure(dbCfg);
    cfg.setDataStorageConfiguration(dbCfg);
    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    if (indexingEnabled())
        ccfg.setIndexedTypes(Integer.class, DbValue.class);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);
    ccfg.setRebalanceMode(SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    CacheConfiguration ccfg2 = new CacheConfiguration("non-primitive");
    if (indexingEnabled())
        ccfg2.setIndexedTypes(DbKey.class, DbValue.class);
    ccfg2.setAtomicityMode(TRANSACTIONAL);
    ccfg2.setWriteSynchronizationMode(FULL_SYNC);
    ccfg2.setRebalanceMode(SYNC);
    ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
    CacheConfiguration ccfg3 = new CacheConfiguration("large");
    if (indexingEnabled())
        ccfg3.setIndexedTypes(Integer.class, LargeDbValue.class);
    ccfg3.setAtomicityMode(TRANSACTIONAL);
    ccfg3.setWriteSynchronizationMode(FULL_SYNC);
    ccfg3.setRebalanceMode(SYNC);
    ccfg3.setAffinity(new RendezvousAffinityFunction(false, 32));
    CacheConfiguration ccfg4 = new CacheConfiguration("tiny");
    ccfg4.setAtomicityMode(TRANSACTIONAL);
    ccfg4.setWriteSynchronizationMode(FULL_SYNC);
    ccfg4.setRebalanceMode(SYNC);
    ccfg4.setAffinity(new RendezvousAffinityFunction(1, null));
    CacheConfiguration ccfg5 = new CacheConfiguration("atomic");
    if (indexingEnabled())
        ccfg5.setIndexedTypes(DbKey.class, DbValue.class);
    ccfg5.setAtomicityMode(ATOMIC);
    ccfg5.setWriteSynchronizationMode(FULL_SYNC);
    ccfg5.setRebalanceMode(SYNC);
    ccfg5.setAffinity(new RendezvousAffinityFunction(false, 32));
    if (!client)
        cfg.setCacheConfiguration(ccfg, ccfg2, ccfg3, ccfg4, ccfg5);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    cfg.setMarshaller(null);
    configure(cfg);
    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