org.apache.ignite.configuration.IgniteConfiguration Java Examples

The following examples show how to use org.apache.ignite.configuration.IgniteConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IgniteCacheFieldsQueryNoDataSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setIndexedTypes(
        String.class, Integer.class
    );

    cfg.setCacheConfiguration(cache);

    return cfg;
}
 
Example #2
Source File: IgniteCacheQueryNodeRestartSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    c.setConsistentId(igniteInstanceName);

    CacheConfiguration<?, ?> cc = defaultCacheConfiguration();

    cc.setCacheMode(PARTITIONED);
    cc.setBackups(1);
    cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cc.setAtomicityMode(TRANSACTIONAL);
    cc.setRebalanceMode(SYNC);
    cc.setAffinity(new RendezvousAffinityFunction(false, 15));
    cc.setIndexedTypes(
        Integer.class, Integer.class
    );

    c.setCacheConfiguration(cc);
    c.setIncludeEventTypes(EventType.EVTS_ALL);

    return c;
}
 
Example #3
Source File: AbstractSnapshotSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi discoSpi = new BlockingCustomMessageDiscoverySpi();

    discoSpi.setIpFinder(((TcpDiscoverySpi)cfg.getDiscoverySpi()).getIpFinder());

    return cfg.setConsistentId(igniteInstanceName)
        .setCommunicationSpi(new TestRecordingCommunicationSpi())
        .setDataStorageConfiguration(new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
                .setMaxSize(100L * 1024 * 1024)
                .setPersistenceEnabled(persistence))
            .setCheckpointFrequency(3000)
            .setPageSize(4096))
        .setCacheConfiguration(dfltCacheCfg)
        .setClusterStateOnStart(INACTIVE)
        .setDiscoverySpi(discoSpi);
}
 
Example #4
Source File: HibernateL2CacheSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();

    discoSpi.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(discoSpi);

    cfg.setCacheConfiguration(generalRegionConfiguration(DEFAULT_UPDATE_TIMESTAMPS_REGION_UNQUALIFIED_NAME),
        generalRegionConfiguration(DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME),
        transactionalRegionConfiguration(ENTITY_NAME),
        transactionalRegionConfiguration(ENTITY2_NAME),
        transactionalRegionConfiguration(VERSIONED_ENTITY_NAME),
        transactionalRegionConfiguration(PARENT_ENTITY_NAME),
        transactionalRegionConfiguration(CHILD_ENTITY_NAME),
        transactionalRegionConfiguration(CHILD_COLLECTION_REGION),
        transactionalRegionConfiguration(NATURAL_ID_REGION),
        transactionalRegionConfiguration(NATURAL_ID_REGION2));

    return cfg;
}
 
Example #5
Source File: CacheDataPageScanQueryTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String instanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(instanceName);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
                    .setMaxSize(DFLT_DATA_REGION_INITIAL_SIZE)
            ));

    cfg.setCacheConfiguration(
        new CacheConfiguration(CACHE)
            .setAtomicityMode(ATOMIC)
            .setAffinity(
                new RendezvousAffinityFunction()
                    .setPartitions(PARTS)
            )
    );

    return cfg;
}
 
Example #6
Source File: GridCacheBasicStoreAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);

    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    CacheConfiguration cc = defaultCacheConfiguration();

    cc.setCacheMode(cacheMode());
    cc.setWriteSynchronizationMode(FULL_SYNC);
    cc.setAtomicityMode(atomicityMode());
    cc.setRebalanceMode(SYNC);

    cc.setCacheStoreFactory(singletonFactory(store));
    cc.setReadThrough(true);
    cc.setWriteThrough(true);
    cc.setLoadPreviousValue(true);

    c.setCacheConfiguration(cc);

    return c;
}
 
Example #7
Source File: IgniteCacheMultiTxLockSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    ccfg.setName(CACHE_NAME);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
    ccfg.setBackups(2);
    ccfg.setCacheMode(PARTITIONED);

    LruEvictionPolicy plc = new LruEvictionPolicy();
    plc.setMaxSize(100000);

    ccfg.setEvictionPolicy(plc);
    ccfg.setOnheapCacheEnabled(true);

    c.setCacheConfiguration(ccfg);

    return c;
}
 
Example #8
Source File: IgniteCacheMessageRecoveryAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();

    commSpi.setSocketWriteTimeout(1000);
    commSpi.setSharedMemoryPort(-1);
    commSpi.setConnectionsPerNode(connectionsPerNode());

    cfg.setCommunicationSpi(commSpi);

    CacheConfiguration ccfg = defaultCacheConfiguration();

    ccfg.setCacheMode(PARTITIONED);
    ccfg.setAtomicityMode(atomicityMode());
    ccfg.setBackups(1);
    ccfg.setNearConfiguration(null);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example #9
Source File: ScanQueryOffheapExpiryPolicySelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    CacheConfiguration ccfg = defaultCacheConfiguration();

    ccfg.setName(CACHE_NAME);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setBackups(1);
    ccfg.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.MINUTES, 10)));

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example #10
Source File: GridCachePreloadLifecycleAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
        IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

        c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
        c.setIncludeProperties();
        c.setDeploymentMode(DeploymentMode.SHARED);
        c.setNetworkTimeout(10000);
        c.setConnectorConfiguration(null);

//        c.setPeerClassLoadingLocalClassPathExclude(GridCachePreloadLifecycleAbstractTest.class.getName(),
//            MyValue.class.getName());

        c.setPublicThreadPoolSize(10);
        c.setSystemThreadPoolSize(10);
        c.setPeerClassLoadingThreadPoolSize(3);

        c.setLifecycleBeans(lifecycleBean);

        return c;
    }
 
Example #11
Source File: IgniteCacheCollocatedQuerySelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<?,?> cacheCfg = defaultCacheConfiguration();

    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setBackups(1);
    cacheCfg.setIndexedTypes(
        AffinityUuid.class, Purchase.class
    );

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
Example #12
Source File: IgnitePersistentStoreTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
private IgniteConfiguration igniteConfig() throws IOException {
    URL url = getClass().getClassLoader().getResource("org/apache/ignite/tests/persistence/pojo/persistence-settings-3.xml");
    String persistence = U.readFileToString(url.getFile(), "UTF-8");

    KeyValuePersistenceSettings persistenceSettings = new KeyValuePersistenceSettings(persistence);

    DataSource dataSource = new DataSource();
    dataSource.setContactPoints(CassandraHelper.getContactPointsArray());
    dataSource.setCredentials(new CassandraAdminCredentials());
    dataSource.setLoadBalancingPolicy(new RoundRobinPolicy());

    CassandraCacheStoreFactory<String, Person> storeFactory = new CassandraCacheStoreFactory<>();
    storeFactory.setDataSource(dataSource);
    storeFactory.setPersistenceSettings(persistenceSettings);

    CacheConfiguration<String, Person> cacheConfiguration = new CacheConfiguration<>();
    cacheConfiguration.setName("cache1");
    cacheConfiguration.setReadThrough(true);
    cacheConfiguration.setWriteThrough(true);
    cacheConfiguration.setCacheStoreFactory(storeFactory);

    IgniteConfiguration config = new IgniteConfiguration();
    config.setCacheConfiguration(cacheConfiguration);

    return config;
}
 
Example #13
Source File: GridAbstractTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/**
 * @return Test kernal context.
 */
protected GridTestKernalContext newContext() throws IgniteCheckedException {
    IgniteConfiguration cfg = new IgniteConfiguration();

    cfg.setClientMode(false);
    cfg.setDiscoverySpi(new TcpDiscoverySpi() {
        @Override public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException {
            // No-op.
        }
    });
    cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi() {
        @Override protected void register(SystemView<?> sysView) {
            // No-op.
        }
    });

    GridTestKernalContext ctx = new GridTestKernalContext(log(), cfg);
    return ctx;
}
 
Example #14
Source File: GridCachePartitionedProjectionAffinitySelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration cacheCfg = defaultCacheConfiguration();

    cacheCfg.setCacheMode(PARTITIONED);
    cacheCfg.setBackups(BACKUPS);
    cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    cacheCfg.setRebalanceMode(SYNC);
    cacheCfg.setAtomicityMode(TRANSACTIONAL);

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
Example #15
Source File: IgniteDbPutGetWithCacheStoreTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    DataStorageConfiguration dbCfg = new DataStorageConfiguration();

    dbCfg
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(512L * 1024 * 1024)
                .setPersistenceEnabled(true))
        .setWalMode(WALMode.LOG_ONLY);

    cfg.setDataStorageConfiguration(dbCfg);

    CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(CACHE_NAME)
        .setCacheStoreFactory(new IgniteReflectionFactory<>(TestStore.class))
        .setAtomicityMode(atomicityMode)
        .setBackups(1)
        .setWriteThrough(true)
        .setReadThrough(true);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example #16
Source File: CacheContinuousBatchAckTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    if (igniteInstanceName.endsWith(CLIENT)) {
        cfg.setClientMode(true);

        cfg.setCommunicationSpi(new FailedTcpCommunicationSpi(true, false));
    }
    else if (igniteInstanceName.endsWith(SERVER2))
        cfg.setCommunicationSpi(new FailedTcpCommunicationSpi(false, true));
    else
        cfg.setCommunicationSpi(new FailedTcpCommunicationSpi(false, false));

    return cfg;
}
 
Example #17
Source File: LongDestroyDurableBackgroundTaskTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    return super.getConfiguration(igniteInstanceName)
        .setDataStorageConfiguration(
            new DataStorageConfiguration().setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
                    .setInitialSize(10 * 1024L * 1024L)
                    .setMaxSize(50 * 1024L * 1024L)
            )
            .setCheckpointFrequency(Long.MAX_VALUE / 2)
        )
        .setCacheConfiguration(
            new CacheConfiguration(DEFAULT_CACHE_NAME)
                .setBackups(1)
                .setSqlSchema("PUBLIC")
        )
        .setGridLogger(testLog);
}
 
Example #18
Source File: IgniteWALTailIsReachedDuringIterationOverArchiveTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(name);

    cfg.setDataStorageConfiguration(
        new DataStorageConfiguration()
            .setWalSegmentSize(WAL_SEGMENT_SIZE)
            .setWalSegments(2)
            .setDefaultDataRegionConfiguration(
                new DataRegionConfiguration()
                    .setPersistenceEnabled(true)
            )
    );

    cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME));

    return cfg;
}
 
Example #19
Source File: TcpCommunicationSpiMultiJvmTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    TcpCommunicationSpi commSpi = new TestCommunicationSpi(replacingAttrSpi);
    commSpi.setLocalPort(45010);

    if (localAddrStr != null)
        commSpi.setLocalAddress(localAddrStr);

    if (externalAddr != null) {

        commSpi.setAddressResolver(new AddressResolver() {
            @Override public Collection<InetSocketAddress> getExternalAddresses(
                InetSocketAddress addr) throws IgniteCheckedException {
                return Collections.singletonList(externalAddr);
            }
        });
    }
    else
        commSpi.setLocalAddress(InetAddress.getLocalHost().getHostName());

    cfg.setCommunicationSpi(commSpi);

    return cfg;
}
 
Example #20
Source File: GridCacheMarshallingNodeJoinSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    MvccFeatureChecker.skipIfNotSupported(MvccFeatureChecker.Feature.CACHE_STORE);

    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<Integer, TestObject> cacheCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    cacheCfg.setCacheMode(CacheMode.PARTITIONED);
    cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
    cacheCfg.setCacheStoreFactory(new StoreFactory());
    cacheCfg.setReadThrough(true);
    cacheCfg.setLoadPreviousValue(true);

    cfg.setCacheConfiguration(cacheCfg);

    return cfg;
}
 
Example #21
Source File: JdbcThinStatementCancelSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration<?,?> cache = defaultCacheConfiguration();

    cache.setCacheMode(PARTITIONED);
    cache.setBackups(1);
    cache.setWriteSynchronizationMode(FULL_SYNC);
    cache.setSqlFunctionClasses(TestSQLFunctions.class);
    cache.setIndexedTypes(Integer.class, Integer.class, Long.class, Long.class, String.class,
        JdbcThinAbstractDmlStatementSelfTest.Person.class);

    cfg.setCacheConfiguration(cache);

    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(IP_FINDER);

    cfg.setDiscoverySpi(disco);

    cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration().
        setThreadPoolSize(SERVER_THREAD_POOL_SIZE));

    return cfg;
}
 
Example #22
Source File: IgnitePdsPartitionsStateRecoveryTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    DataStorageConfiguration dsCfg = new DataStorageConfiguration()
        .setWalMode(WALMode.LOG_ONLY)
        .setWalSegmentSize(16 * 1024 * 1024)
        .setCheckpointFrequency(20 * 60 * 1000)
        .setDefaultDataRegionConfiguration(
            new DataRegionConfiguration()
                .setMaxSize(512 * 1024 * 1024)
                .setPersistenceEnabled(true)
        );

    cfg.setDataStorageConfiguration(dsCfg);

    CacheConfiguration ccfg = defaultCacheConfiguration()
        .setBackups(0)
        .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
        .setAffinity(new RendezvousAffinityFunction(false, PARTS_CNT));

    // Disable rebalance to prevent owning MOVING partitions.
    if (MvccFeatureChecker.forcedMvcc())
        ccfg.setRebalanceDelay(Long.MAX_VALUE);
    else
        ccfg.setRebalanceMode(CacheRebalanceMode.NONE);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example #23
Source File: IgniteThreadPoolSizeTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * Performs testing for wrong tread pool size.
 *
 * @param cfg an IgniteConfiguration with the only one thread pool size assigned with the WRONG_VALUE.
 * @throws Exception If failed.
 */
private void testWrongPoolSize(IgniteConfiguration cfg) throws Exception {
    try {
        Ignition.start(cfg);

        fail();
    }
    catch (IgniteException ex) {
        assertNotNull(ex.getMessage());
        assertTrue(ex.getMessage().contains("thread pool size"));
    }
}
 
Example #24
Source File: GridFactorySelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testGridStartRollback() throws Exception {
    GridTestUtils.assertThrows(
        log,
        new Callable<Object>() {
            @Nullable @Override public Object call() throws Exception {
                IgniteConfiguration cfg = new IgniteConfiguration();

                cfg.setConnectorConfiguration(null);

                cfg.setDiscoverySpi(new TcpDiscoverySpi() {
                    @Override public void spiStart(String igniteInstanceName) throws IgniteSpiException {
                        throw new IgniteSpiException("This SPI will never start.");
                    }
                });

                G.start(cfg);

                info("Thread finished.");

                return null;
            }
        },
        IgniteException.class,
        null
    );
}
 
Example #25
Source File: Log4j2LoggerSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * Creates grid configuration.
 *
 * @param igniteInstanceName Ignite instance name.
 * @param logPath Logger configuration path.
 * @return Grid configuration.
 * @throws Exception If error occurred.
 */
private static IgniteConfiguration getConfiguration(String igniteInstanceName, String logPath)
    throws Exception {
    TcpDiscoverySpi disco = new TcpDiscoverySpi();

    disco.setIpFinder(new TcpDiscoveryVmIpFinder(false) {{
        setAddresses(Collections.singleton("127.0.0.1:47500..47509"));
    }});

    return new IgniteConfiguration()
        .setIgniteInstanceName(igniteInstanceName)
        .setGridLogger(new Log4J2Logger(logPath))
        .setConnectorConfiguration(null)
        .setDiscoverySpi(disco);
}
 
Example #26
Source File: LocalAffinityFunctionTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    ccfg.setBackups(1);
    ccfg.setName(CACHE1);
    ccfg.setCacheMode(CacheMode.LOCAL);
    ccfg.setAffinity(new RendezvousAffinityFunction());
    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example #27
Source File: GridCacheTxLoadFromStoreOnLockSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.getTransactionConfiguration().setTxSerializableEnabled(true);

    return cfg;
}
 
Example #28
Source File: IgniteInternalCacheTypesTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    if (igniteInstanceName.equals(getTestIgniteInstanceName(0))) {
        CacheConfiguration ccfg = defaultCacheConfiguration();

        ccfg.setName(CACHE1);

        cfg.setCacheConfiguration(ccfg);
    }

    return cfg;
}
 
Example #29
Source File: IgnitePutAllLargeBatchSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setCacheConfiguration(cacheConfiguration(igniteInstanceName));

    return cfg;
}
 
Example #30
Source File: ApplicationConfiguration.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @return Ignite instance.
 */
@Bean
public Ignite igniteInstance() {
    IgniteConfiguration cfg = new IgniteConfiguration()
        .setCacheConfiguration(
            new CacheConfiguration<Integer, Person>("PersonCache")
                .setIndexedTypes(Integer.class, Person.class),
            new CacheConfiguration<PersonKey, Person>("PersonWithKeyCache")
        )
        .setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(new TcpDiscoveryVmIpFinder(true)));

    return Ignition.start(cfg);
}