Search in sources :

Example 1 with CoalescingDelayedTrigger

use of com.hazelcast.internal.util.scheduler.CoalescingDelayedTrigger in project hazelcast by hazelcast.

the class MapKeyLoader method triggerLoadingWithDelay.

/**
 * Triggers key loading on SENDER if it hadn't started. Delays triggering if invoked multiple times.
 */
public void triggerLoadingWithDelay() {
    if (delayedTrigger == null) {
        Runnable runnable = () -> {
            Operation op = new TriggerLoadIfNeededOperation(mapName);
            opService.invokeOnPartition(SERVICE_NAME, op, mapNamePartition);
        };
        delayedTrigger = new CoalescingDelayedTrigger(execService, LOADING_TRIGGER_DELAY, LOADING_TRIGGER_DELAY, runnable);
    }
    delayedTrigger.executeWithDelay();
}
Also used : CoalescingDelayedTrigger(com.hazelcast.internal.util.scheduler.CoalescingDelayedTrigger) KeyLoadStatusOperation(com.hazelcast.map.impl.operation.KeyLoadStatusOperation) TriggerLoadIfNeededOperation(com.hazelcast.map.impl.operation.TriggerLoadIfNeededOperation) Operation(com.hazelcast.spi.impl.operationservice.Operation) MapOperation(com.hazelcast.map.impl.operation.MapOperation) TriggerLoadIfNeededOperation(com.hazelcast.map.impl.operation.TriggerLoadIfNeededOperation)

Aggregations

CoalescingDelayedTrigger (com.hazelcast.internal.util.scheduler.CoalescingDelayedTrigger)1 KeyLoadStatusOperation (com.hazelcast.map.impl.operation.KeyLoadStatusOperation)1 MapOperation (com.hazelcast.map.impl.operation.MapOperation)1 TriggerLoadIfNeededOperation (com.hazelcast.map.impl.operation.TriggerLoadIfNeededOperation)1 Operation (com.hazelcast.spi.impl.operationservice.Operation)1