Search in sources :

Example 66 with DataRegionConfiguration

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

the class IgniteCacheDatabaseSharedManager method createSystemDataRegion.

/**
 * @param sysCacheInitSize Initial size of PageMemory to be created for system cache.
 * @param sysCacheMaxSize Maximum size of PageMemory to be created for system cache.
 * @param persistenceEnabled Persistence enabled flag.
 *
 * @return {@link DataRegionConfiguration configuration} of DataRegion for system cache.
 */
private DataRegionConfiguration createSystemDataRegion(long sysCacheInitSize, long sysCacheMaxSize, boolean persistenceEnabled) {
    DataRegionConfiguration res = new DataRegionConfiguration();
    res.setName(SYSTEM_DATA_REGION_NAME);
    res.setInitialSize(sysCacheInitSize);
    res.setMaxSize(sysCacheMaxSize);
    res.setPersistenceEnabled(persistenceEnabled);
    return res;
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration)

Example 67 with DataRegionConfiguration

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

the class IgniteCacheDatabaseSharedManager method initPageMemoryDataStructures.

/**
 * @param dbCfg Database config.
 * @throws IgniteCheckedException If failed.
 */
protected void initPageMemoryDataStructures(DataStorageConfiguration dbCfg) throws IgniteCheckedException {
    freeListMap = U.newHashMap(dataRegionMap.size());
    String dfltMemPlcName = dbCfg.getDefaultDataRegionConfiguration().getName();
    for (DataRegion memPlc : dataRegionMap.values()) {
        DataRegionConfiguration memPlcCfg = memPlc.config();
        DataRegionMetricsImpl memMetrics = (DataRegionMetricsImpl) memMetricsMap.get(memPlcCfg.getName());
        boolean persistenceEnabled = memPlcCfg.isPersistenceEnabled();
        CacheFreeListImpl freeList = new CacheFreeListImpl(0, cctx.igniteInstanceName(), memMetrics, memPlc, null, persistenceEnabled ? cctx.wal() : null, 0L, true);
        freeListMap.put(memPlcCfg.getName(), freeList);
    }
    dfltFreeList = freeListMap.get(dfltMemPlcName);
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) CacheFreeListImpl(org.apache.ignite.internal.processors.cache.persistence.freelist.CacheFreeListImpl)

Example 68 with DataRegionConfiguration

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

the class IgniteCacheDatabaseSharedManager method initDataRegions.

/**
 * @param memCfg Database config.
 * @throws IgniteCheckedException If failed to initialize swap path.
 */
protected void initDataRegions(DataStorageConfiguration memCfg) throws IgniteCheckedException {
    if (dataRegionsInitialized)
        return;
    DataRegionConfiguration[] dataRegionCfgs = memCfg.getDataRegionConfigurations();
    int dataRegions = dataRegionCfgs == null ? 0 : dataRegionCfgs.length;
    dataRegionMap = U.newHashMap(3 + dataRegions);
    memMetricsMap = U.newHashMap(3 + dataRegions);
    if (dataRegionCfgs != null) {
        for (DataRegionConfiguration dataRegionCfg : dataRegionCfgs) addDataRegion(memCfg, dataRegionCfg, dataRegionCfg.isPersistenceEnabled());
    }
    addDataRegion(memCfg, memCfg.getDefaultDataRegionConfiguration(), memCfg.getDefaultDataRegionConfiguration().isPersistenceEnabled());
    addDataRegion(memCfg, createSystemDataRegion(memCfg.getSystemRegionInitialSize(), memCfg.getSystemRegionMaxSize(), CU.isPersistenceEnabled(memCfg)), CU.isPersistenceEnabled(memCfg));
    dataRegionsInitialized = true;
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration)

Example 69 with DataRegionConfiguration

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

the class Authentication1kUsersNodeRestartTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(spi);
    cfg.setAuthenticationEnabled(true);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
    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 70 with DataRegionConfiguration

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

the class AuthenticationOnNotActiveClusterTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (getTestIgniteInstanceIndex(igniteInstanceName) == CLI_NODE)
        cfg.setClientMode(true);
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(spi);
    cfg.setAuthenticationEnabled(true);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
    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)

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