Search in sources :

Example 56 with CacheConfiguration

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

the class GridAffinitySelfTest method getConfiguration.

/** {@inheritDoc} */
@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.setFailureDetectionTimeout(Integer.MAX_VALUE);
    if (igniteInstanceName.endsWith("1"))
        cfg.setClientMode(true);
    else {
        assert igniteInstanceName.endsWith("2");
        CacheConfiguration cacheCfg = defaultCacheConfiguration();
        cacheCfg.setCacheMode(PARTITIONED);
        cacheCfg.setBackups(1);
        cfg.setCacheConfiguration(cacheCfg);
    }
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 57 with CacheConfiguration

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

the class BinaryTreeSelfTest method configuration.

/**
     * Create configuration.
     *
     * @param name Node name.
     * @param client Client mode flag.
     * @return Configuration.
     */
private static IgniteConfiguration configuration(String name, boolean client) {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(name);
    cfg.setClientMode(client);
    cfg.setLocalHost("127.0.0.1");
    cfg.setPeerClassLoadingEnabled(false);
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500"));
    discoSpi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(discoSpi);
    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    ccfg.setCacheMode(CacheMode.PARTITIONED);
    cfg.setCacheConfiguration(ccfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 58 with CacheConfiguration

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

the class GridBinaryAffinityKeySelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
    typeCfg.setTypeName(TestObject.class.getName());
    BinaryConfiguration bCfg = new BinaryConfiguration();
    bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
    cfg.setBinaryConfiguration(bCfg);
    CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject.class.getName(), "affKey");
    CacheKeyConfiguration keyCfg2 = new CacheKeyConfiguration("TestObject2", "affKey");
    cfg.setCacheKeyConfiguration(keyCfg, keyCfg2);
    cfg.setMarshaller(new BinaryMarshaller());
    if (!igniteInstanceName.equals(getTestIgniteInstanceName(GRID_CNT))) {
        CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
        cacheCfg.setCacheMode(PARTITIONED);
        cfg.setCacheConfiguration(cacheCfg);
    }
    ((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
    return cfg;
}
Also used : CacheKeyConfiguration(org.apache.ignite.cache.CacheKeyConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryConfiguration(org.apache.ignite.configuration.BinaryConfiguration) BinaryTypeConfiguration(org.apache.ignite.binary.BinaryTypeConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 59 with CacheConfiguration

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

the class GridCacheMixedPartitionExchangeSelfTest method cacheConfiguration.

/**
     * @return Cache configuration.
     */
private CacheConfiguration cacheConfiguration() {
    CacheConfiguration ccfg = defaultCacheConfiguration();
    ccfg.setCacheMode(PARTITIONED);
    ccfg.setAtomicityMode(TRANSACTIONAL);
    ccfg.setNearConfiguration(null);
    ccfg.setBackups(1);
    return ccfg;
}
Also used : CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 60 with CacheConfiguration

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

the class GridCacheMultinodeUpdateAbstractSelfTest method cacheConfiguration.

/** {@inheritDoc} */
@Override
protected CacheConfiguration cacheConfiguration(String igniteInstanceName) throws Exception {
    CacheConfiguration ccfg = super.cacheConfiguration(igniteInstanceName);
    ccfg.setCacheStoreFactory(null);
    ccfg.setReadThrough(false);
    ccfg.setWriteThrough(false);
    return ccfg;
}
Also used : CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Aggregations

CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)980 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)392 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)287 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)250 Ignite (org.apache.ignite.Ignite)148 ArrayList (java.util.ArrayList)69 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)64 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)59 QueryEntity (org.apache.ignite.cache.QueryEntity)44 IgniteException (org.apache.ignite.IgniteException)43 CacheException (javax.cache.CacheException)42 IgfsGroupDataBlocksKeyMapper (org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper)40 IgniteEx (org.apache.ignite.internal.IgniteEx)40 IgniteCache (org.apache.ignite.IgniteCache)39 LinkedHashMap (java.util.LinkedHashMap)35 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)34 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)32 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)30 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)30 Transaction (org.apache.ignite.transactions.Transaction)28