Search in sources :

Example 1 with EvictionPolicy

use of org.apache.ignite.cache.eviction.EvictionPolicy in project ignite by apache.

the class GridCacheEvictionManager method start0.

/**
 * {@inheritDoc}
 */
@Override
public void start0() throws IgniteCheckedException {
    CacheConfiguration cfg = cctx.config();
    if (cctx.isNear()) {
        plc = (cfg.getNearConfiguration().getNearEvictionPolicyFactory() != null) ? (EvictionPolicy) cfg.getNearConfiguration().getNearEvictionPolicyFactory().create() : cfg.getNearConfiguration().getNearEvictionPolicy();
    } else if (cfg.getEvictionPolicyFactory() != null)
        plc = (EvictionPolicy) cfg.getEvictionPolicyFactory().create();
    else
        plc = cfg.getEvictionPolicy();
    plcEnabled = plc != null;
    if (plcEnabled)
        prepare(cfg, plc, cctx.isNear());
    filter = cfg.getEvictionFilter();
    if (log.isDebugEnabled())
        log.debug("Eviction manager started on node: " + cctx.nodeId());
}
Also used : EvictionPolicy(org.apache.ignite.cache.eviction.EvictionPolicy) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 2 with EvictionPolicy

use of org.apache.ignite.cache.eviction.EvictionPolicy in project ignite by apache.

the class EvictionAbstractTest method testEvictionPolicyMbeanValidity.

/**
 * @throws Exception if failed.
 */
@Test
public void testEvictionPolicyMbeanValidity() throws Exception {
    try {
        Ignite ignite = startGrids(2);
        // Instantiate policy object to know exact class.
        EvictionPolicy plc = createPolicy(0);
        validateMbeans(ignite, plc.getClass().getName());
    } finally {
        stopAllGrids();
    }
}
Also used : EvictionPolicy(org.apache.ignite.cache.eviction.EvictionPolicy) Ignite(org.apache.ignite.Ignite) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

EvictionPolicy (org.apache.ignite.cache.eviction.EvictionPolicy)2 Ignite (org.apache.ignite.Ignite)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)1 Test (org.junit.Test)1