in cassovary-core/src/main/scala/com/twitter/cassovary/graph/SharedArrayBasedDirectedGraph.scala [188:209]
def construct(): SharedArrayBasedDirectedGraph = {
val future = for {
partsMetaInfo <- readMetaInfoPerShard()
metaInfo = aggregateMetaInfoFromParts(partsMetaInfo)
nodeCollection = new NodeCollection(metaInfo, forceSparseRepr)
sharedEdgeArray = instantiateSharedArray(shardsInfo)
_ <- fillEdgesMarkNodeOffsets(iterableSeq, sharedEdgeArray, nodeCollection,
shardsInfo, partsMetaInfo)
outEdges = sharded2dArray(nodeCollection, sharedEdgeArray)
reverseDirEdgeArray <-
if (storedGraphDir == BothInOut)
createReverseDirEdgeArray(outEdges, nodeCollection)
else
Future.value(None)
} yield new SharedArrayBasedDirectedGraph(nodeCollection, outEdges,
reverseDirEdgeArray, metaInfo, storedGraphDir)
val graph = Await.result(future)
log.debug("DONE")
graph
}