// Add the vertex while synchronized to ensure no interference
// from the graph pruner.
LabelVertex vowner = addOrGetVertex(owner);
// add or update edges between task owner and identities
for (Map.Entry<Identity, Long> entry : idMap.entrySet()) {
Identity ident = entry.getKey();
// Our folded graph has no self-loops: only add an
// edge if the identity isn't the owner
if (!ident.equals(owner)) {
LabelVertex vident = addOrGetVertex(ident);
// Check to see if we already have an edge between
// the two vertices. If so, update its weight.
WeightedEdge edge =
affinityGraph.findEdge(vowner, vident);