Search in sources :

Example 81 with DataRegionConfiguration

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

the class PlatformConfigurationUtils method readDataStorageConfiguration.

/**
 * Reads the data storage configuration.
 *
 * @param in Reader.
 * @return Config.
 */
private static DataStorageConfiguration readDataStorageConfiguration(BinaryRawReader in) {
    DataStorageConfiguration res = new DataStorageConfiguration().setStoragePath(in.readString()).setCheckpointFrequency(in.readLong()).setCheckpointThreads(in.readInt()).setLockWaitTime((int) in.readLong()).setWalHistorySize(in.readInt()).setWalSegments(in.readInt()).setWalSegmentSize(in.readInt()).setWalPath(in.readString()).setWalArchivePath(in.readString()).setWalMode(WALMode.fromOrdinal(in.readInt())).setWalThreadLocalBufferSize(in.readInt()).setWalFlushFrequency((int) in.readLong()).setWalFsyncDelayNanos(in.readLong()).setWalRecordIteratorBufferSize(in.readInt()).setAlwaysWriteFullPages(in.readBoolean()).setMetricsEnabled(in.readBoolean()).setMetricsSubIntervalCount(in.readInt()).setMetricsRateTimeInterval(in.readLong()).setCheckpointWriteOrder(CheckpointWriteOrder.fromOrdinal(in.readInt())).setWriteThrottlingEnabled(in.readBoolean()).setWalCompactionEnabled(in.readBoolean()).setSystemRegionInitialSize(in.readLong()).setSystemRegionMaxSize(in.readLong()).setPageSize(in.readInt()).setConcurrencyLevel(in.readInt()).setWalAutoArchiveAfterInactivity(in.readLong());
    int cnt = in.readInt();
    if (cnt > 0) {
        DataRegionConfiguration[] regs = new DataRegionConfiguration[cnt];
        for (int i = 0; i < cnt; i++) {
            regs[i] = readDataRegionConfiguration(in);
        }
        res.setDataRegionConfigurations(regs);
    }
    if (in.readBoolean()) {
        res.setDefaultDataRegionConfiguration(readDataRegionConfiguration(in));
    }
    return res;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration)

Example 82 with DataRegionConfiguration

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

the class JettyRestProcessorAbstractSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    FileSystemConfiguration igfs = new FileSystemConfiguration();
    igfs.setName("igfs");
    igfs.setIpcEndpointConfiguration(new IgfsIpcEndpointConfiguration());
    cfg.setFileSystemConfiguration(igfs);
    DataStorageConfiguration dsCfg = new DataStorageConfiguration();
    DataRegionConfiguration drCfg = new DataRegionConfiguration();
    drCfg.setName("testDataRegion");
    drCfg.setMaxSize(100 * 1024 * 1024);
    dsCfg.setDefaultDataRegionConfiguration(drCfg);
    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) IgfsIpcEndpointConfiguration(org.apache.ignite.igfs.IgfsIpcEndpointConfiguration) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 83 with DataRegionConfiguration

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

the class JettyRestProcessorAuthenticationSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setAuthenticationEnabled(true);
    // For now persistence is needed because of current authentication implementation.
    DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024)).setWalMode(NONE);
    DataRegionConfiguration testDataRegionCfg = new DataRegionConfiguration();
    testDataRegionCfg.setName("testDataRegion");
    testDataRegionCfg.setMaxSize(10 * 1024 * 1024);
    DataRegionConfiguration authDataRegionCfg = new DataRegionConfiguration();
    authDataRegionCfg.setName("authDataRegion").setMaxSize(10 * 1024 * 1024).setPersistenceEnabled(true);
    dsCfg.setDataRegionConfigurations(testDataRegionCfg, authDataRegionCfg);
    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)

Example 84 with DataRegionConfiguration

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

the class NonAffinityCoordinatorDynamicStartStopTest 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 memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024));
    cfg.setDataStorageConfiguration(memCfg);
    if (gridName.contains(DUMMY_GRID_NAME))
        cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE, false));
    else
        cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE, true));
    cfg.setConsistentId(gridName);
    if (gridName.contains("client"))
        cfg.setClientMode(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 85 with DataRegionConfiguration

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

the class IgnitePdsDiskErrorsRecoveringTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setWalCompactionEnabled(false).setWalSegmentSize(WAL_SEGMENT_SIZE).setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
    if (failPageStoreDiskOperations)
        dsCfg.setFileIOFactory(new LimitedSizeFileIOFactory(new RandomAccessFileIOFactory(), diskSpaceBytes));
    cfg.setDataStorageConfiguration(dsCfg);
    CacheConfiguration cacheCfg = new CacheConfiguration(CACHE_NAME).setRebalanceMode(CacheRebalanceMode.NONE).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC).setAffinity(new RendezvousAffinityFunction(false, 1));
    cfg.setCacheConfiguration(cacheCfg);
    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) RandomAccessFileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIOFactory)

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