Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge the two versions of ScanIndex in tablet_impl.cc #2632

Closed
zhanghaohit opened this issue Oct 11, 2022 · 5 comments
Closed

merge the two versions of ScanIndex in tablet_impl.cc #2632

zhanghaohit opened this issue Oct 11, 2022 · 5 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@zhanghaohit
Copy link
Collaborator

Describe the feature you'd like

Most of the logics of the two ScanIndex are the same, except the output buffer. We'd better merge these two.

int32_t TabletImpl::ScanIndex(const ::openmldb::api::ScanRequest* request, const ::openmldb::api::TableMeta& meta,
                              const std::map<int32_t, std::shared_ptr<Schema>>& vers_schema,
                              CombineIterator* combine_it, std::string* pairs, uint32_t* count, bool* is_finish);
int32_t TabletImpl::ScanIndex(const ::openmldb::api::ScanRequest* request, const ::openmldb::api::TableMeta& meta,
                              const std::map<int32_t, std::shared_ptr<Schema>>& vers_schema,
                              CombineIterator* combine_it, butil::IOBuf* io_buf, uint32_t* count, bool* is_finish);
@zhanghaohit zhanghaohit added the good first issue Good for newcomers label Oct 11, 2022
@jkpjkpjkp
Copy link
Contributor

Though 2 ScanIndex functions have 40ish identical lines, I see no obvious way to elegantly merge them together, lest using a global define, since their common lines are mainly declarations of local variables.

@try-agaaain
Copy link
Contributor

I am interested in this task, can it be assigned to me?

@zhanghaohit
Copy link
Collaborator Author

I am interested in this task, can it be assigned to me?

Thanks for your interest. I've assigned this task to you.

@try-agaaain
Copy link
Contributor

In order to merge these two ScanIndex functions, I have set up the compilation environment and compiled tablet_impl_test for debugging. However, because I do not know the business logic, I cannot clearly understand the implementation process of the two ScanIndex functions. Could you please give me some suggestions?

@dl239
Copy link
Collaborator

dl239 commented Nov 2, 2023

another function deleted in #3572

@dl239 dl239 closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants