in cassovary-core/src/main/scala/com/twitter/cassovary/graph/ArrayBasedDynamicDirectedGraph.scala [35:48]
def this(dataIterable: Iterable[NodeIdEdgesMaxId],
storedGraphDir: StoredGraphDir) {
this(storedGraphDir)
for (nodeData <- dataIterable.iterator) {
val id = nodeData.id
getOrCreateNode(id)
nodeData.edges map getOrCreateNode
storedGraphDir match {
case OnlyOut | Mutual => outboundLists(id).addAll(IntArrayList.wrap(nodeData.edges))
case OnlyIn => inboundLists(id).addAll(IntArrayList.wrap(nodeData.edges))
case BothInOut => nodeData.edges map { addEdgeAllowingDuplicates(id, _) } // Duplicates shouldn't exist, but allow them for efficiency.
}
}
}