use of com.hazelcast.mapreduce.impl.HashMapAdapter in project hazelcast by hazelcast.
the class ScheduledExecutorServiceProxy method scheduleOnMembersAtFixedRate.
@Override
public Map<Member, IScheduledFuture<?>> scheduleOnMembersAtFixedRate(Runnable command, Collection<Member> members, long initialDelay, long period, TimeUnit unit) {
checkNotNull(command, "Command is null");
checkNotNull(members, "Members is null");
checkNotNull(unit, "Unit is null");
attachHazelcastInstance(command);
String name = extractNameOrGenerateOne(command);
ScheduledRunnableAdapter<?> adapter = createScheduledRunnableAdapter(command);
Map<Member, IScheduledFuture<?>> futures = new HashMapAdapter<Member, IScheduledFuture<?>>();
for (Member member : members) {
TaskDefinition definition = new TaskDefinition(TaskDefinition.Type.AT_FIXED_RATE, name, adapter, initialDelay, period, unit);
futures.put(member, submitOnMemberSync(name, new ScheduleTaskOperation(getName(), definition), member));
}
return futures;
}
Aggregations