@Override public void map( final NullWritable key, final FaunusVertex value, final Mapper<NullWritable, FaunusVertex, NullWritable, FaunusVertex>.Context context) throws IOException, InterruptedException { long pathsFiltered = 0l; if (this.isVertex) { if (value.hasPaths()) { final Iterator<List<MicroElement>> itty = value.getPaths().iterator(); while (itty.hasNext()) { final List<MicroElement> path = itty.next(); this.set.clear(); this.set.addAll(path); if (path.size() != this.set.size()) { itty.remove(); pathsFiltered++; } } } } else { for (final Edge e : value.getEdges(Direction.BOTH)) { final FaunusEdge edge = (FaunusEdge) e; if (edge.hasPaths()) { final Iterator<List<MicroElement>> itty = edge.getPaths().iterator(); while (itty.hasNext()) { final List<MicroElement> path = itty.next(); this.set.clear(); this.set.addAll(path); if (path.size() != this.set.size()) { itty.remove(); pathsFiltered++; } } } } } context.getCounter(Counters.PATHS_FILTERED).increment(pathsFiltered); context.write(NullWritable.get(), value); }