mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-12-23 02:31:52 +01:00
Merge 6ee0d2b7ac
into fb54d8b549
This commit is contained in:
commit
6cbdbc9632
@ -75,21 +75,23 @@ class WorkerGetIntersectionHandler @Inject() (
|
|||||||
val rightNeighborsOpt =
|
val rightNeighborsOpt =
|
||||||
rightEdgeMap.get(featureType.rightEdgeType).flatMap(_.get(candidateId))
|
rightEdgeMap.get(featureType.rightEdgeType).flatMap(_.get(candidateId))
|
||||||
|
|
||||||
if (leftNeighborsOpt.isEmpty && rightNeighborsOpt.isEmpty) {
|
(leftNeighborsOpt, rightNeighborsOpt) match {
|
||||||
EmptyWorkerIntersectionValue
|
case (Some(leftNeighbors), None) =>
|
||||||
} else if (rightNeighborsOpt.isEmpty) {
|
|
||||||
EmptyWorkerIntersectionValue.copy(
|
EmptyWorkerIntersectionValue.copy(
|
||||||
leftNodeDegree = computeArraySize(leftNeighborsOpt.get)
|
leftNodeDegree = computeArraySize(leftNeighbors)
|
||||||
)
|
)
|
||||||
} else if (leftNeighborsOpt.isEmpty) {
|
case (None, Some(rightNeighbors)) =>
|
||||||
EmptyWorkerIntersectionValue.copy(
|
EmptyWorkerIntersectionValue.copy(
|
||||||
rightNodeDegree = computeArraySize(rightNeighborsOpt.get)
|
rightNodeDegree = computeArraySize(rightNeighbors)
|
||||||
)
|
)
|
||||||
} else {
|
case (Some(leftNeighbors), Some(rightNeighbors)) =>
|
||||||
IntersectionValueCalculator(
|
IntersectionValueCalculator(
|
||||||
leftNeighborsOpt.get,
|
leftNeighbors,
|
||||||
rightNeighborsOpt.get,
|
rightNeighbors,
|
||||||
request.intersectionIdLimit)
|
request.intersectionIdLimit
|
||||||
|
)
|
||||||
|
case _ =>
|
||||||
|
EmptyWorkerIntersectionValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user