alibaba / GraphScope

🔨 🍇 💻 🚀 GraphScope: A One-Stop Large-Scale Graph Computing System from Alibaba | 一站式图计算系统
https://graphscope.io
Apache License 2.0
3.31k stars 448 forks source link

refactor(interactive): Template the runtime module #4293

Closed zhanglei1949 closed 1 week ago

zhanglei1949 commented 1 month ago

Template the runtime module. This PR includes changes of two kinds

TODO:

We expose the Graph Interface via the following template class. Note this template's function are only defined, no implementation is provided.

template <typename GRAPH_IMPL>
class GraphInterface {
 public:
  using label_id_t = label_t;
  using vertex_index_t = typename GRAPH_IMPL::vertex_index_t;
  using edge_iterator_t = impl::EdgeIterator<GRAPH_IMPL>;

  template <typename EDATA_T>
  using sub_graph_t = impl::SubGraph<EDATA_T, GRAPH_IMPL>;

  label_id_t VertexLabelNum();
  label_id_t EdgeLabelNum() const;
  std::vector<label_id_t> GetVertexLabels() const;
  std::vector<label_id_t> GetEdgeLabels() const;
  label_id_t GetVertexLabelId(const std::string& label) const;
};

We specialize the template class for ReadTransaction. In this PR, we don't refactor the interface, we adapt almost the same interface as ReadTransaction.

github-actions[bot] commented 1 month ago

Please check the preview of the documentation changes at https://52e47196.graphscope-docs-preview.pages.dev

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 58.78%. Comparing base (0aa119e) to head (81eefa4). Report is 2 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/alibaba/GraphScope/pull/4293/graphs/tree.svg?width=650&height=150&src=pr&token=S5G9F02T3J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba)](https://app.codecov.io/gh/alibaba/GraphScope/pull/4293?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) ```diff @@ Coverage Diff @@ ## main #4293 +/- ## =========================================== + Coverage 36.96% 58.78% +21.82% =========================================== Files 126 12 -114 Lines 13235 592 -12643 =========================================== - Hits 4892 348 -4544 + Misses 8343 244 -8099 ``` [see 114 files with indirect coverage changes](https://app.codecov.io/gh/alibaba/GraphScope/pull/4293/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/alibaba/GraphScope/pull/4293?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/alibaba/GraphScope/pull/4293?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba). Last update [0aa119e...81eefa4](https://app.codecov.io/gh/alibaba/GraphScope/pull/4293?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba).