in graphjet-core/src/main/java/com/twitter/graphjet/algorithms/filters/TweetAuthorFilter.java [78:99]
private LongSet getTweetsByAuthors(
LeftIndexedMultiSegmentBipartiteGraph leftIndexedBipartiteGraph,
LongSet tweetAuthors) {
LongSet authoredTweets = new LongOpenHashSet();
for (long authorId: tweetAuthors) {
EdgeIterator edgeIterator = leftIndexedBipartiteGraph.getLeftNodeEdges(authorId);
if (edgeIterator == null) {
continue;
}
// Sequentially iterating through the latest MAX_EDGES_PER_NODE edges per node
int numEdgesPerNode = 0;
while (edgeIterator.hasNext() && numEdgesPerNode++ < RecommendationRequest.MAX_EDGES_PER_NODE) {
long rightNode = edgeIterator.nextLong();
byte edgeType = edgeIterator.currentEdgeType();
if (edgeType == RecommendationRequest.AUTHOR_SOCIAL_PROOF_TYPE) {
authoredTweets.add(rightNode);
}
}
}
return authoredTweets;
}