Search in sources :

Example 1 with BatchInvalidator

use of com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator 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 BatchInvalidator

use of com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator 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

BatchInvalidator (com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator)2 NonStopInvalidator (com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator)2 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)2