Search in sources :

Example 51 with BinaryConfiguration

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

the class IgnitePdsTransactionsHangTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    discoSpi.setIpFinder(IP_FINDER);
    cfg.setDiscoverySpi(discoSpi);
    BinaryConfiguration binaryCfg = new BinaryConfiguration();
    binaryCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(binaryCfg);
    cfg.setPeerClassLoadingEnabled(true);
    TcpCommunicationSpi tcpCommSpi = new TcpCommunicationSpi();
    tcpCommSpi.setSharedMemoryPort(-1);
    cfg.setCommunicationSpi(tcpCommSpi);
    TransactionConfiguration txCfg = new TransactionConfiguration();
    txCfg.setDefaultTxIsolation(TransactionIsolation.READ_COMMITTED);
    cfg.setTransactionConfiguration(txCfg);
    DataRegionConfiguration memPlcCfg = new DataRegionConfiguration();
    memPlcCfg.setName("dfltDataRegion");
    memPlcCfg.setInitialSize(PAGE_CACHE_SIZE * 1024 * 1024);
    memPlcCfg.setMaxSize(PAGE_CACHE_SIZE * 1024 * 1024);
    memPlcCfg.setPersistenceEnabled(true);
    DataStorageConfiguration memCfg = new DataStorageConfiguration();
    memCfg.setDefaultDataRegionConfiguration(memPlcCfg);
    memCfg.setWalHistorySize(1);
    memCfg.setCheckpointFrequency(CHECKPOINT_FREQUENCY);
    memCfg.setPageSize(PAGE_SIZE * 1024);
    cfg.setDataStorageConfiguration(memCfg);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 52 with BinaryConfiguration

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

the class IgniteMassLoadSandboxTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<Integer, HugeIndexedObject> ccfg = new CacheConfiguration<>();
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, 1024));
    ccfg.setIndexedTypes(Integer.class, HugeIndexedObject.class);
    ccfg.setName(CACHE_NAME);
    cfg.setCacheConfiguration(ccfg);
    DataRegionConfiguration regCfg = new DataRegionConfiguration().setName("dfltMemPlc").setMetricsEnabled(true).setMaxSize(2 * 1024L * 1024 * 1024).setPersistenceEnabled(true);
    DataStorageConfiguration dsCfg = new DataStorageConfiguration();
    dsCfg.setDefaultDataRegionConfiguration(regCfg).setPageSize(4 * 1024).setWriteThrottlingEnabled(true).setCheckpointFrequency(checkpointFrequency);
    final String workDir = U.defaultWorkDirectory();
    final File db = U.resolveWorkDirectory(workDir, DFLT_STORE_DIR, false);
    final File wal = new File(db, "wal");
    if (setWalArchAndWorkToSameVal) {
        final String walAbsPath = wal.getAbsolutePath();
        dsCfg.setWalPath(walAbsPath);
        dsCfg.setWalArchivePath(walAbsPath);
    } else {
        dsCfg.setWalPath(wal.getAbsolutePath());
        dsCfg.setWalArchivePath(new File(wal, "archive").getAbsolutePath());
    }
    dsCfg.setWalMode(customWalMode != null ? customWalMode : WALMode.LOG_ONLY).setWalHistorySize(1).setWalSegments(10);
    if (walSegmentSize != 0)
        dsCfg.setWalSegmentSize(walSegmentSize);
    cfg.setDataStorageConfiguration(dsCfg);
    cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
    return cfg;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) 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) File(java.io.File) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 53 with BinaryConfiguration

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

the class WalRecoveryTxLogicalRecordsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);
    CacheConfiguration<Integer, IndexedValue> ccfg = new CacheConfiguration<>(CACHE_NAME);
    ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    ccfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    ccfg.setAffinity(new RendezvousAffinityFunction(false, PARTS));
    ccfg.setIndexedTypes(Integer.class, IndexedValue.class);
    if (extraCcfg != null)
        cfg.setCacheConfiguration(ccfg, new CacheConfiguration<>(extraCcfg));
    else
        cfg.setCacheConfiguration(ccfg);
    DataStorageConfiguration dbCfg = new DataStorageConfiguration();
    dbCfg.setPageSize(pageSize);
    dbCfg.setWalHistorySize(WAL_HIST_SIZE);
    dbCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true));
    if (checkpointFreq != null)
        dbCfg.setCheckpointFrequency(checkpointFreq);
    cfg.setDataStorageConfiguration(dbCfg);
    cfg.setMarshaller(null);
    BinaryConfiguration binCfg = new BinaryConfiguration();
    binCfg.setCompactFooter(false);
    cfg.setBinaryConfiguration(binCfg);
    return cfg;
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) 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 54 with BinaryConfiguration

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

the class TcpClientDiscoveryMarshallerCheckSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    if (testFooter) {
        cfg.setMarshaller(new BinaryMarshaller());
        TcpDiscoverySpi spi = new TcpDiscoverySpi();
        // IGNITE-605, and further tests limitation bypass
        spi.setJoinTimeout(-1);
        cfg.setDiscoverySpi(spi);
        if (igniteInstanceName.endsWith("0")) {
            BinaryConfiguration bc = new BinaryConfiguration();
            bc.setCompactFooter(false);
            cfg.setBinaryConfiguration(bc);
            cfg.setClientMode(true);
        }
    } else {
        if (igniteInstanceName.endsWith("0"))
            cfg.setMarshaller(new JdkMarshaller());
        else {
            cfg.setClientMode(true);
            cfg.setMarshaller(new BinaryMarshaller());
        }
        TcpDiscoverySpi spi = new TcpDiscoverySpi().setIpFinder(ipFinder);
        cfg.setDiscoverySpi(spi);
    }
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) JdkMarshaller(org.apache.ignite.marshaller.jdk.JdkMarshaller)

Example 55 with BinaryConfiguration

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

the class DummyPersistenceCompatibilityTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setPeerClassLoadingEnabled(false);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
    cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(compactFooter));
    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)

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