use of com.hazelcast.scheduledexecutor.impl.ScheduledTaskDescriptor in project hazelcast by hazelcast.
the class ReplicationOperation method run.
@Override
public void run() throws Exception {
DistributedScheduledExecutorService service = getService();
ScheduledExecutorPartition partition = service.getPartition(getPartitionId());
for (Map.Entry<String, Map<String, ScheduledTaskDescriptor>> entry : map.entrySet()) {
ScheduledExecutorContainer container = partition.getOrCreateContainer(entry.getKey());
for (Map.Entry<String, ScheduledTaskDescriptor> descriptorEntry : entry.getValue().entrySet()) {
String taskName = descriptorEntry.getKey();
ScheduledTaskDescriptor descriptor = descriptorEntry.getValue();
if (!container.has(taskName)) {
container.stash(descriptor);
}
}
}
}
use of com.hazelcast.scheduledexecutor.impl.ScheduledTaskDescriptor in project hazelcast by hazelcast.
the class AbstractGetAllScheduledOperation method populateScheduledForHolder.
protected void populateScheduledForHolder(List<ScheduledTaskHandler> handlers, DistributedScheduledExecutorService service, int holderId) {
ScheduledExecutorContainerHolder partition = service.getPartitionOrMemberBin(holderId);
ScheduledExecutorContainer container = partition.getContainer(schedulerName);
if (container == null || service.isShutdown(schedulerName)) {
return;
}
Collection<ScheduledTaskDescriptor> tasks = container.getTasks();
for (ScheduledTaskDescriptor task : tasks) {
if (task.isTaskOwner()) {
handlers.add(container.offprintHandler(task.getDefinition().getName()));
}
}
}
Aggregations