Search in sources :

Example 46 with BinaryConfiguration

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

the class IgniteWalRecoverySeveralRestartsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(cacheName);
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
    ccfg.setIndexedTypes(Integer.class, IndexedObject.class);
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    // 64 per node
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 64 * 4));
    ccfg.setReadFromBackup(true);
    cfg.setCacheConfiguration(ccfg);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(500 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY).setPageSize(PAGE_SIZE);
    cfg.setDataStorageConfiguration(memCfg);
    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 47 with BinaryConfiguration

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

the class IgniteWalRecoveryTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<Integer, IndexedObject> ccfg = new CacheConfiguration<>(cacheName);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setNodeFilter(new RemoteNodeFilter());
    ccfg.setIndexedTypes(Integer.class, IndexedObject.class);
    cfg.setCacheConfiguration(ccfg);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    dbCfg.setPageSize(4 * 1024);
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("dfltDataRegion");
    memPlcCfg.setInitialSize(1024 * 1024 * 1024);
    memPlcCfg.setMaxSize(1024 * 1024 * 1024);
    memPlcCfg.setPersistenceEnabled(true);
    dbCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    dbCfg.setWalRecordIteratorBufferSize(1024 * 1024);
    dbCfg.setWalHistorySize(2);
    if (logOnly)
        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);
    if (!getTestIgniteInstanceName(0).equals(gridName))
        cfg.setUserAttributes(F.asMap(HAS_CACHE, true));
    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 48 with BinaryConfiguration

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

the class GridCacheBinaryStoreBinariesSimpleNameMappersSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    BinaryConfiguration bCfg = cfg.getBinaryConfiguration();
    bCfg.setNameMapper(new BinaryBasicNameMapper());
    bCfg.setIdMapper(new BinaryBasicIdMapper(true));
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryBasicNameMapper(org.apache.ignite.binary.BinaryBasicNameMapper) BinaryBasicIdMapper(org.apache.ignite.binary.BinaryBasicIdMapper)

Example 49 with BinaryConfiguration

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

the class IgnitePersistentStoreCacheGroupsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    cfg.setConsistentId(gridName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)).setPageSize(1024).setWalMode(WALMode.LOG_ONLY);
    cfg.setDataStorageConfiguration(memCfg);
    cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
    if (ccfgs != null) {
        cfg.setCacheConfiguration(ccfgs);
        ccfgs = null;
    }
    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) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 50 with BinaryConfiguration

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

the class IgnitePdsMultiNodePutGetRestartTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY);
    cfg.setDataStorageConfiguration(memCfg);
    CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
    ccfg.setIndexedTypes(Integer.class, DbValue.class);
    ccfg.setRebalanceMode(CacheRebalanceMode.NONE);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
    ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cfg.setCacheConfiguration(ccfg);
    cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
    cfg.setMarshaller(null);
    BinaryConfiguration bCfg = new BinaryConfiguration();
    bCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(bCfg);
    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) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)59 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)49 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)26 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)20 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)19 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)17 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)16 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)14 BinaryBasicNameMapper (org.apache.ignite.binary.BinaryBasicNameMapper)11 BinaryBasicIdMapper (org.apache.ignite.binary.BinaryBasicIdMapper)10 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)10 MarshallerContextTestImpl (org.apache.ignite.marshaller.MarshallerContextTestImpl)6 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 CacheKeyConfiguration (org.apache.ignite.cache.CacheKeyConfiguration)5 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)5 NullLogger (org.apache.ignite.logger.NullLogger)5 LinkedHashMap (java.util.LinkedHashMap)4 IgniteException (org.apache.ignite.IgniteException)4 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)4