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

[c++] Handling edge cases for C++ re-indexer #2098

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Conversation

beroy
Copy link
Collaborator

@beroy beroy commented Jan 31, 2024

Issue and/or context:
Some of the edge case like negative size table and handling thread sizes smaller or equal to one could be handled better
Changes:

Notes for Reviewer:

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Merging #2098 (f6678fe) into main (e4080f6) will increase coverage by 3.33%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2098      +/-   ##
==========================================
+ Coverage   76.72%   80.06%   +3.33%     
==========================================
  Files         136       87      -49     
  Lines       10672     8040    -2632     
  Branches      207        0     -207     
==========================================
- Hits         8188     6437    -1751     
+ Misses       2386     1603     -783     
+ Partials       98        0      -98     
Flag Coverage Δ
libtiledbsoma ?
python 91.48% <ø> (+0.64%) ⬆️
r 69.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 91.48% <ø> (+0.64%) ⬆️
libtiledbsoma ∅ <ø> (∅)

Copy link
Member

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionally looks fine, but it could be simplified and cleaned up a bit:

  • use unsigned types for arguments which should never (can never) be negative.
  • remove thread_count_ instance value which, as used, seems redundant with the tiledb_thread_pool_ slot

libtiledbsoma/src/reindexer/reindexer.cc Outdated Show resolved Hide resolved
libtiledbsoma/src/reindexer/reindexer.h Outdated Show resolved Hide resolved
@beroy beroy force-pushed the edgecases_for_reindexer branch 4 times, most recently from 8b85b19 to a0ac10c Compare January 31, 2024 23:04
@beroy
Copy link
Collaborator Author

beroy commented Jan 31, 2024

@bkmartinjr done with fixing both issue and now waiting for CI

if (size == 0) {
return;
}
if (threads == 0) {
throw std::runtime_error("Re-indexer thread count cannot be zero.");
}

LOG_DEBUG(fmt::format(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to have duplicate logging here - same information is in both statements....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

LOG_DEBUG(fmt::format(
"Lookup with thread concurrency {} on data size {}",
tiledb_thread_pool_->concurrency_level(),
size));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these two log lines are largely redundant as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit: comment in line 30 is incorrect (looks like copy & paste error)

Copy link
Member

@bkmartinjr bkmartinjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple of minor nits to pick, otherwise LGTM. TY.

@johnkerl johnkerl merged commit f650956 into main Feb 1, 2024
15 checks passed
@johnkerl johnkerl deleted the edgecases_for_reindexer branch February 1, 2024 16:01
johnkerl pushed a commit that referenced this pull request Feb 1, 2024
Co-authored-by: beroy <beroy2000@gmail.com>
@johnkerl johnkerl changed the title [C++] Handling edge cases for C++ re-indexer [c++] Handling edge cases for C++ re-indexer Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants