Search in sources :

Example 81 with DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration 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 DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration 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 DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration 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 DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration 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 DataStorageConfiguration

use of org.apache.ignite.configuration.DataStorageConfiguration 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

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