Search in sources :

Example 1 with NonStopInvalidator

use of com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator in project hazelcast by hazelcast.

the class MapNearCacheManager method createInvalidator.

private Invalidator createInvalidator() {
    HazelcastProperties hazelcastProperties = nodeEngine.getProperties();
    int batchSize = hazelcastProperties.getInteger(MAP_INVALIDATION_MESSAGE_BATCH_SIZE);
    int batchFrequencySeconds = hazelcastProperties.getInteger(MAP_INVALIDATION_MESSAGE_BATCH_FREQUENCY_SECONDS);
    boolean batchingEnabled = hazelcastProperties.getBoolean(MAP_INVALIDATION_MESSAGE_BATCH_ENABLED) && batchSize > 1;
    if (batchingEnabled) {
        return new BatchInvalidator(SERVICE_NAME, batchSize, batchFrequencySeconds, INVALIDATION_ACCEPTOR, nodeEngine);
    } else {
        return new NonStopInvalidator(SERVICE_NAME, INVALIDATION_ACCEPTOR, nodeEngine);
    }
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) BatchInvalidator(com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator) NonStopInvalidator(com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator)

Example 2 with NonStopInvalidator

use of com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator in project hazelcast by hazelcast.

the class NonStopInvalidatorTest method setUp.

@Before
public void setUp() {
    key = mock(Data.class);
    HazelcastInstance hz = createHazelcastInstance();
    NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(hz);
    invalidator = new NonStopInvalidator(MapService.SERVICE_NAME, TRUE_FILTER, nodeEngineImpl);
}
Also used : NodeEngineImpl(com.hazelcast.spi.impl.NodeEngineImpl) HazelcastInstance(com.hazelcast.core.HazelcastInstance) Data(com.hazelcast.nio.serialization.Data) NonStopInvalidator(com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator) Before(org.junit.Before)

Example 3 with NonStopInvalidator

use of com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator in project hazelcast by hazelcast.

the class CacheEventHandler method createInvalidator.

private Invalidator createInvalidator() {
    HazelcastProperties hazelcastProperties = nodeEngine.getProperties();
    int batchSize = hazelcastProperties.getInteger(CACHE_INVALIDATION_MESSAGE_BATCH_SIZE);
    int batchFrequencySeconds = hazelcastProperties.getInteger(CACHE_INVALIDATION_MESSAGE_BATCH_FREQUENCY_SECONDS);
    boolean batchingEnabled = hazelcastProperties.getBoolean(CACHE_INVALIDATION_MESSAGE_BATCH_ENABLED) && batchSize > 1;
    if (batchingEnabled) {
        return new BatchInvalidator(SERVICE_NAME, batchSize, batchFrequencySeconds, TRUE_FILTER, nodeEngine);
    } else {
        return new NonStopInvalidator(SERVICE_NAME, TRUE_FILTER, nodeEngine);
    }
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) BatchInvalidator(com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator) NonStopInvalidator(com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator)

Aggregations

NonStopInvalidator (com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator)3 BatchInvalidator (com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator)2 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 Data (com.hazelcast.nio.serialization.Data)1 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)1 Before (org.junit.Before)1