in cassovary-core/src/main/scala/com/twitter/cassovary/graph/ArrayBasedDynamicDirectedGraph.scala [191:211]
override def getOrCreateNode(id: Int): DynamicNode = {
def addIdToList(list: ArrayBuffer[IntArrayList]) {
if (list.size <= id) {
list.appendAll(Array.fill(id - list.size + 1 )(null))
}
list(id) = new IntArrayList(initialNeighborListCapacity)
}
if (!nodeExists(id)) {
_nodeCount += 1
if (StoredGraphDir.isOutDirStored(storedGraphDir)) {
addIdToList(outboundLists)
}
if (StoredGraphDir.isInDirStored(storedGraphDir) &&
storedGraphDir != StoredGraphDir.Mutual) {
addIdToList(inboundLists)
}
}
getNodeById(id).get
}