Search in sources :

Example 1 with GridCacheAlwaysEvictionPolicy

use of org.apache.ignite.internal.processors.cache.GridCacheAlwaysEvictionPolicy in project ignite by apache.

the class CacheGetInsideLockChangingTopologyTest method beforeTestsStarted.

/** {@inheritDoc} */
@Override
protected void beforeTestsStarted() throws Exception {
    super.beforeTestsStarted();
    startGridsMultiThreaded(SRVS);
    client.set(true);
    Ignite client1 = startGrid(SRVS);
    assertTrue(client1.configuration().isClientMode());
    client.set(true);
    Ignite client2 = startGrid(SRVS + 1);
    assertTrue(client2.configuration().isClientMode());
    client2.createNearCache(TX_CACHE1, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>()));
    client2.createNearCache(TX_CACHE2, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>()));
    client2.createNearCache(ATOMIC_CACHE, new NearCacheConfiguration<>().setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy<>()));
}
Also used : Ignite(org.apache.ignite.Ignite) GridCacheAlwaysEvictionPolicy(org.apache.ignite.internal.processors.cache.GridCacheAlwaysEvictionPolicy) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration)

Example 2 with GridCacheAlwaysEvictionPolicy

use of org.apache.ignite.internal.processors.cache.GridCacheAlwaysEvictionPolicy in project ignite by apache.

the class GridCachePartitionedMultiThreadedPutGetSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
    c.getTransactionConfiguration().setTxSerializableEnabled(true);
    CacheConfiguration cc = defaultCacheConfiguration();
    cc.setCacheMode(PARTITIONED);
    cc.setBackups(1);
    cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
    FifoEvictionPolicy plc = new FifoEvictionPolicy();
    plc.setMaxMemorySize(1000);
    cc.setEvictionPolicy(plc);
    cc.setOnheapCacheEnabled(true);
    cc.setAtomicityMode(TRANSACTIONAL);
    NearCacheConfiguration nearCfg = new NearCacheConfiguration();
    nearCfg.setNearEvictionPolicy(new GridCacheAlwaysEvictionPolicy());
    cc.setNearConfiguration(nearCfg);
    c.setCacheConfiguration(cc);
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(ipFinder);
    c.setDiscoverySpi(spi);
    return c;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) GridCacheAlwaysEvictionPolicy(org.apache.ignite.internal.processors.cache.GridCacheAlwaysEvictionPolicy) FifoEvictionPolicy(org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) NearCacheConfiguration(org.apache.ignite.configuration.NearCacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)2 GridCacheAlwaysEvictionPolicy (org.apache.ignite.internal.processors.cache.GridCacheAlwaysEvictionPolicy)2 Ignite (org.apache.ignite.Ignite)1 FifoEvictionPolicy (org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)1