twitter / GraphJet

GraphJet is a real-time graph processing library.
Apache License 2.0
716 stars 111 forks source link

Remove Unfavorited edges from social proof recommendations #109

Closed guimingTang closed 6 years ago

guimingTang commented 6 years ago

This review adds the ability to remove "unfavorited" social proofs from the social proof recommendation pipeline. Mainly, it removes unfavorited social proofs for tweets. It achieves this by doing the following:

  1. Relocated removeUnfavoritedSocialProofs(NodeInfo) method from counting/ directory to algorithm/ directory, under NodeInfoHelper.java, so it can be re-used in soialproof/ directory as well.
  2. Check if the incoming request asks for favorite as one of the social proof types, collect all the unfavorited edges engaged on the tweets as well, in addition to the favorite edges.
  3. In the step of social proof generation, we re-use the unfavorite removal utility function to remove the intersection between the favorite edge and the unfavorite edge, hence removing the "unfavorited" edges.
  4. A few test cases were added to safe guard the change.

Note: This does not add the unfavorite capability to node metadata social proofs, as it has its separate code path and requires further refactoring (NodeMetadataSocialProofGenerator.java). That is a separate issue from what this review addresses.