/** * This is to build maps of nodes that are at the same location, and to build their master to * slave relationship. The master to slave relationship is purely arbitrary, the first node at a * location to be found becoming the master. */ protected void aggregateSameLocationNodes() { this.parent.getNodeIdentifierToAtlasIndices().forEach(identifier -> { final Node master = this.parent.node(identifier); final Set<Node> slaves = nodesOverlapping(master); slaves.remove(master); if (!slaves.isEmpty()) { if (!this.overlappingNodeIdentifierToMasterNodeIdentifier.containsKey(identifier)) { // if our master is not already a slave slaves.forEach(node -> { final long slaveIdentifier = node.getIdentifier(); this.overlappingNodeIdentifierToMasterNodeIdentifier.put(slaveIdentifier, identifier); this.masterNodeIdentifierToOverlappingNodeIdentifier.add(identifier, slaveIdentifier); }); warnIfNodesHaveDifferentTags(master, slaves); } } }); }