use of org.apache.ignite.internal.visor.util.VisorClusterGroupEmptyException in project ignite by apache.
the class VisorQueryCleanupTask method map0.
/**
* {@inheritDoc}
*/
@Override
protected Map<? extends ComputeJob, ClusterNode> map0(List<ClusterNode> subgrid, @Nullable VisorTaskArgument<VisorQueryCleanupTaskArg> arg) {
Set<UUID> nodeIds = taskArg.getQueryIds().keySet();
if (nodeIds.isEmpty())
throw new VisorClusterGroupEmptyException("Nothing to clear. List with node IDs is empty!");
Map<ComputeJob, ClusterNode> map = U.newHashMap(nodeIds.size());
try {
for (ClusterNode node : subgrid) if (nodeIds.contains(node.id()))
map.put(new VisorQueryCleanupJob(taskArg.getQueryIds().get(node.id()), debug), node);
if (map.isEmpty()) {
StringBuilder notFoundNodes = new StringBuilder();
for (UUID nid : nodeIds) notFoundNodes.append((notFoundNodes.length() == 0) ? "" : ",").append(U.id8(nid));
throw new VisorClusterGroupEmptyException("Failed to clear query results. Nodes are not available: [" + notFoundNodes + "]");
}
return map;
} finally {
if (debug)
logMapped(ignite.log(), getClass(), map.values());
}
}
Aggregations