// Send LastChunk notifications
for (Map.Entry<Address, Map<KeyOut, Chunk>> entry : mapping.entrySet()) {
Address receiver = entry.getKey();
Map<KeyOut, Chunk> chunk = entry.getValue();
mapReduceService
.sendNotification(receiver, new LastChunkNotification(receiver, name, jobId, sender, partitionId, chunk));
}
// Send LastChunk notification to notify reducers that received at least one chunk
Set<Address> addresses = mapping.keySet();
Collection<Address> reducerInterests = supervisor.getReducerEventInterests(partitionId);
if (reducerInterests != null) {
for (Address address : reducerInterests) {
if (!addresses.contains(address)) {
mapReduceService.sendNotification(address,
new LastChunkNotification(address, name, jobId, sender, partitionId, Collections.emptyMap()));
}
}
}
}