Search in sources :

Example 46 with DataStorageConfiguration

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

the class SwapPathConstructionSelfTest method createMemoryConfiguration.

/**
 * @param isRelativePath flag is set to {@code true} if relative path should be used for data region configuration.
 */
private DataStorageConfiguration createMemoryConfiguration(boolean isRelativePath) {
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("default");
    memPlcCfg.setMaxSize(20 * 1024 * 1024);
    if (isRelativePath)
        memPlcCfg.setSwapPath(RELATIVE_SWAP_PATH);
    else
        memPlcCfg.setSwapPath(Paths.get(getTmpDir(), ABSOLUTE_SWAP_PATH).toString());
    memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    return memCfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration)

Example 47 with DataStorageConfiguration

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

the class TxPessimisticDeadlockDetectionTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (isDebug()) {
        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
        discoSpi.failureDetectionTimeoutEnabled(false);
        cfg.setDiscoverySpi(discoSpi);
    }
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE * 10).setName("dfltPlc"));
    cfg.setDataStorageConfiguration(memCfg);
    cfg.setClientMode(client);
    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 48 with DataStorageConfiguration

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

the class JdbcThinAuthenticateConnectionSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("deprecation")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    TcpDiscoverySpi disco = new TcpDiscoverySpi();
    disco.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(disco);
    cfg.setMarshaller(new BinaryMarshaller());
    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) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 49 with DataStorageConfiguration

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

the class StandaloneGridKernalContext method prepareIgniteConfiguration.

/**
 * @return Ignite configuration which allows to start requied processors for WAL reader
 */
private IgniteConfiguration prepareIgniteConfiguration() {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setDiscoverySpi(new StandaloneNoopDiscoverySpi());
    cfg.setCommunicationSpi(new StandaloneNoopCommunicationSpi());
    final Marshaller marshaller = new BinaryMarshaller();
    cfg.setMarshaller(marshaller);
    final DataStorageConfiguration pstCfg = new DataStorageConfiguration();
    final DataRegionConfiguration regCfg = new DataRegionConfiguration();
    regCfg.setPersistenceEnabled(true);
    pstCfg.setDefaultDataRegionConfiguration(regCfg);
    cfg.setDataStorageConfiguration(pstCfg);
    marshaller.setContext(marshallerCtx);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) Marshaller(org.apache.ignite.marshaller.Marshaller) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller)

Example 50 with DataStorageConfiguration

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

the class IgniteCacheDatabaseSharedManager method start0.

/**
 * {@inheritDoc}
 */
@Override
protected void start0() throws IgniteCheckedException {
    if (cctx.kernalContext().clientNode() && cctx.kernalContext().config().getDataStorageConfiguration() == null)
        return;
    DataStorageConfiguration memCfg = cctx.kernalContext().config().getDataStorageConfiguration();
    assert memCfg != null;
    validateConfiguration(memCfg);
    pageSize = memCfg.getPageSize();
    initDataRegions(memCfg);
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration)

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