Search in sources :

Example 36 with DataRegionConfiguration

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

the class IgnitePdsPageEvictionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(50 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setPageSize(1024).setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
    cfg.setDataStorageConfiguration(memCfg);
    CacheConfiguration<DbKey, DbValue> ccfg = new CacheConfiguration<>(CACHE_NAME);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
    ccfg.setIndexedTypes(DbKey.class, DbValue.class);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    cfg.setCacheConfiguration(ccfg);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
    cfg.setMarshaller(null);
    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 37 with DataRegionConfiguration

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

the class IgnitePdsRebalancingOnNotStableTopologyTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setActiveOnStart(false);
    CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<>(CACHE_NAME);
    ccfg.setPartitionLossPolicy(PartitionLossPolicy.READ_ONLY_SAFE);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setBackups(2);
    cfg.setCacheConfiguration(ccfg);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setCheckpointFrequency(CHECKPOINT_FREQUENCY);
    cfg.setDataStorageConfiguration(memCfg);
    return cfg;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) 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)

Example 38 with DataRegionConfiguration

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

the class IgnitePdsCacheIntegrationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
    cfg.setDataStorageConfiguration(memCfg);
    CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
    ccfg.setIndexedTypes(Integer.class, DbValue.class);
    ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    cfg.setCacheConfiguration(ccfg);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
    cfg.setMarshaller(null);
    BinaryConfiguration bCfg = new BinaryConfiguration();
    bCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(bCfg);
    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) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 39 with DataRegionConfiguration

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

the class WalModeChangeCommonAbstractSelfTest method config.

/**
 * Create node configuration.
 *
 * @param name Name.
 * @param cli Client flag.
 * @param filter Whether node should be filtered out.
 * @return Node configuration.
 */
protected IgniteConfiguration config(String name, boolean cli, boolean filter) {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(name);
    cfg.setClientMode(cli);
    cfg.setLocalHost("127.0.0.1");
    cfg.setDiscoverySpi(new IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi().setIpFinder(IP_FINDER));
    DataRegionConfiguration regionCfg = new DataRegionConfiguration().setPersistenceEnabled(true);
    DataRegionConfiguration volatileRegionCfg = new DataRegionConfiguration().setName(REGION_VOLATILE).setPersistenceEnabled(false);
    DataStorageConfiguration storageCfg = new DataStorageConfiguration();
    storageCfg.setDefaultDataRegionConfiguration(regionCfg);
    storageCfg.setDataRegionConfigurations(volatileRegionCfg);
    cfg.setDataStorageConfiguration(storageCfg);
    if (filter)
        cfg.setUserAttributes(Collections.singletonMap(FILTER_ATTR, true));
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 40 with DataRegionConfiguration

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

the class IndexStoragePageMemoryImplTest method memory.

/**
 * @param clean Clean flag. If {@code true}, will clean previous memory state and allocate
 *      new empty page memory.
 * @return Page memory instance.
 */
@Override
protected PageMemory memory(boolean clean) throws Exception {
    long[] sizes = new long[10];
    for (int i = 0; i < sizes.length; i++) sizes[i] = 1024 * 1024;
    DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath);
    GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(new GridTestKernalContext(log), null, null, null, new NoOpPageStoreManager(), new NoOpWALManager(), null, new IgniteCacheDatabaseSharedManager(), null, null, null, null, null, null, null, null);
    return new PageMemoryImpl(provider, sizes, sharedCtx, PAGE_SIZE, (fullPageId, byteBuf, tag) -> {
        assert false : "No page replacement (rotation with disk) should happen during the test";
    }, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {

        @Override
        public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
        }
    }, () -> true, new DataRegionMetricsImpl(new DataRegionConfiguration()), PageMemoryImpl.ThrottlingPolicy.DISABLED, null);
}
Also used : MappedFileMemoryProvider(org.apache.ignite.internal.mem.file.MappedFileMemoryProvider) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) FullPageId(org.apache.ignite.internal.pagemem.FullPageId)

Aggregations

DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)147 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)119 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)108 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)48 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)45 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)33 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)16 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)15 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)10 PageMemory (org.apache.ignite.internal.pagemem.PageMemory)9 DirectMemoryProvider (org.apache.ignite.internal.mem.DirectMemoryProvider)8 File (java.io.File)7 PageMemoryNoStoreImpl (org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl)7 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 MappedFileMemoryProvider (org.apache.ignite.internal.mem.file.MappedFileMemoryProvider)5 FullPageId (org.apache.ignite.internal.pagemem.FullPageId)5 GridCacheSharedContext (org.apache.ignite.internal.processors.cache.GridCacheSharedContext)5 IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)5 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)4