mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 14:48:54 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
20 lines
565 B
Scala
20 lines
565 B
Scala
package com.twitter.graph_feature_service.worker.util
|
|
|
|
import com.twitter.graph_feature_service.thriftscala.EdgeType
|
|
import com.twitter.util.Future
|
|
|
|
case class GraphContainer(
|
|
graphs: Map[GraphKey, AutoUpdatingGraph]) {
|
|
|
|
final val toPartialMap: Map[EdgeType, AutoUpdatingGraph] =
|
|
graphs.collect {
|
|
case (partialValueGraph: PartialValueGraph, graph) =>
|
|
partialValueGraph.edgeType -> graph
|
|
}
|
|
|
|
// load all the graphs from constantDB format to memory
|
|
def warmup: Future[Unit] = {
|
|
Future.collect(graphs.mapValues(_.warmup())).unit
|
|
}
|
|
}
|