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

IGNITE-16266 Add unique id for indexes #672

Closed
wants to merge 14 commits into from

Conversation

AMashenkov
Copy link
Member

Copy link
Contributor

@korlov42 korlov42 left a comment

Choose a reason for hiding this comment

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

Hi, @AMashenkov! What about SQL-related part? We need to fix that as well. You could use patch from this ticket as reference.

* @param idxName Index name.
* @throws IndexNotFoundException If not found.
*/
void checkIndexById(String tag, String idxName);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need a idxName param here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I fix RelInputImpl#checkIndexById method, my fail, name needed only for possible error message.

@zstan zstan requested a review from korlov42 March 30, 2022 18:32
InternalSortedIndex idx = indexManager.getIndexById(id);

if (idx == null) {
throw new IndexNotFoundException(idxName, id);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem right to pass an idxName param only for case when index is not found. Probably, there should be one more constructor of IndexNotFoundException accepting the Id only

Copy link
Contributor

Choose a reason for hiding this comment

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

refactored here.

IgniteIndex old = indexById.remove(idx0.id());

if (old == null) {
LOG.trace(IgniteStringFormatter.format("Index [name={}] not found in inner store.", idxName));
Copy link
Member Author

Choose a reason for hiding this comment

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

Let's avoid string creation if the TRACE log-level is disabled.

Suggested change
LOG.trace(IgniteStringFormatter.format("Index [name={}] not found in inner store.", idxName));
LOG.trace(() -> IgniteStringFormatter.format("Index [name={}] not found in inner store.", idxName));

@AMashenkov AMashenkov closed this Apr 12, 2022
@AMashenkov AMashenkov deleted the ignite-16266 branch April 12, 2022 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants