twitter / GraphJet

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

Refactor SocialProofGenerator to utilize NodeInfo #108

Closed guimingTang closed 6 years ago

guimingTang commented 6 years ago

This review includes mainly refactoring work, with NO change in the algorithm logic. We will be starting to utilize NodeInfo data structure in the socialproof/ algorithms for social proof recommendations.

The reason for this refactoring is as follows. NodeInfo is a data structure that is heavily utilized in the counting sort algorithms pipeline. It is mainly used to hold engagements on the right nodes. In social proof generation algorithms, however, we do not use this data type, and instead maintains a separate, more primitive data structures to achieve the exact same purpose. This creates redundancy and code that is hard to maintain.

For this reason, I made social proof algorithms rely on NodeInfo instead. This will pave way for the unfavorite indexing that will be implemented separately.

guimingTang commented 6 years ago

Since the existing test case is relatively weak, I will add another test case soon.