Search in sources :

Example 21 with DataStorageConfiguration

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

the class IgnitePdsCheckpointSimulationWithRealCpDisabledTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration ccfg = new CacheConfiguration(cacheName);
    ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
    cfg.setCacheConfiguration(ccfg);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setCheckpointFrequency(500).setWalMode(WALMode.LOG_ONLY).setAlwaysWriteFullPages(true).setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 22 with DataStorageConfiguration

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

the class IgnitePdsThreadInterruptionTest method storageConfiguration.

/**
 * @return DataStorage configuration.
 */
private DataStorageConfiguration storageConfiguration() {
    DataRegionConfiguration regionCfg = new DataRegionConfiguration().setInitialSize(10L * 1024L * 1024L).setMaxSize(10L * 1024L * 1024L).setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU);
    DataStorageConfiguration cfg = new DataStorageConfiguration().setWalMode(WALMode.LOG_ONLY).setWalFsyncDelayNanos(0).setPageSize(PAGE_SIZE).setFileIOFactory(new AsyncFileIOFactory());
    cfg.setDefaultDataRegionConfiguration(regionCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) AsyncFileIOFactory(org.apache.ignite.internal.processors.cache.persistence.file.AsyncFileIOFactory)

Example 23 with DataStorageConfiguration

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

the class IgniteUidAsConsistentIdMigrationTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration(gridName);
    if (configuredConsistentId != null)
        cfg.setConsistentId(configuredConsistentId);
    final DataStorageConfiguration dsCfg = new DataStorageConfiguration();
    if (placeStorageInTemp) {
        final File tempDir = new File(System.getProperty("java.io.tmpdir"));
        pstStoreCustomPath = new File(tempDir, "Store");
        pstWalStoreCustomPath = new File(tempDir, "WalStore");
        pstWalArchCustomPath = new File(tempDir, "WalArchive");
        dsCfg.setStoragePath(pstStoreCustomPath.getAbsolutePath());
        dsCfg.setWalPath(pstWalStoreCustomPath.getAbsolutePath());
        dsCfg.setWalArchivePath(pstWalArchCustomPath.getAbsolutePath());
    }
    dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(32 * 1024 * 1024).setPersistenceEnabled(true));
    cfg.setDataStorageConfiguration(dsCfg);
    if (strLog != null)
        cfg.setGridLogger(strLog);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) File(java.io.File)

Example 24 with DataStorageConfiguration

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

the class IgniteWalRecoveryPPCTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(CACHE_NAME_1);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    cfg.setCacheConfiguration(ccfg);
    CacheConfiguration<Integer, IndexedObject> ccfg2 = new CacheConfiguration<>(CACHE_NAME_2);
    ccfg2.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg2.setDataRegionName(MEM_PLC_NO_PDS);
    cfg.setCacheConfiguration(ccfg, ccfg2);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    dbCfg.setPageSize(4 * 1024);
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setInitialSize(1024 * 1024 * 1024);
    memPlcCfg.setMaxSize(1024 * 1024 * 1024);
    memPlcCfg.setPersistenceEnabled(true);
    dbCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    DataRegionConfiguration memPlcCfg2 = new DataRegionConfiguration();
    memPlcCfg2.setName(MEM_PLC_NO_PDS);
    memPlcCfg2.setInitialSize(1024 * 1024 * 1024);
    memPlcCfg2.setMaxSize(1024 * 1024 * 1024);
    memPlcCfg2.setPersistenceEnabled(false);
    dbCfg.setDataRegionConfigurations(memPlcCfg2);
    dbCfg.setWalRecordIteratorBufferSize(1024 * 1024);
    dbCfg.setWalHistorySize(2);
    dbCfg.setWalMode(WALMode.LOG_ONLY);
    if (walSegmentSize != 0)
        dbCfg.setWalSegmentSize(walSegmentSize);
    cfg.setDataStorageConfiguration(dbCfg);
    cfg.setMarshaller(null);
    BinaryConfiguration binCfg = new BinaryConfiguration();
    binCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(binCfg);
    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)

Example 25 with DataStorageConfiguration

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

the class IgniteWalReaderTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration(gridName);
    final CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(CACHE_NAME);
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setIndexedTypes(Integer.class, IndexedObject.class);
    cfg.setCacheConfiguration(ccfg);
    cfg.setIncludeEventTypes(EventType.EVT_WAL_SEGMENT_ARCHIVED);
    DataStorageConfiguration dsCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(1024 * 1024 * 1024).setPersistenceEnabled(true)).setPageSize(PAGE_SIZE).setWalHistorySize(1).setWalSegmentSize(1024 * 1024).setWalSegments(WAL_SEGMENTS).setWalMode(customWalMode != null ? customWalMode : WALMode.BACKGROUND);
    if (archiveIncompleteSegmentAfterInactivityMs > 0)
        dsCfg.setWalAutoArchiveAfterInactivity(archiveIncompleteSegmentAfterInactivityMs);
    final String workDir = U.defaultWorkDirectory();
    final File db = U.resolveWorkDirectory(workDir, DFLT_STORE_DIR, false);
    final File wal = new File(db, "wal");
    if (setWalAndArchiveToSameValue) {
        final String walAbsPath = wal.getAbsolutePath();
        dsCfg.setWalPath(walAbsPath);
        dsCfg.setWalArchivePath(walAbsPath);
    } else {
        dsCfg.setWalPath(wal.getAbsolutePath());
        dsCfg.setWalArchivePath(new File(wal, "archive").getAbsolutePath());
    }
    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) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) File(java.io.File) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

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