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-21445 New implementation for local IndexQuery #11317

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

oleg-vlsk
Copy link
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com #ignite channel.

@oleg-vlsk oleg-vlsk changed the title Ignite 21445 IGNITE-21445 IndexQuery ignores pageSize if setLocal=true is set Apr 17, 2024
@oleg-vlsk oleg-vlsk changed the title IGNITE-21445 IndexQuery ignores pageSize if setLocal=true is set IGNITE-21445 New implementation for local IndexQuery Apr 17, 2024
}
}, true);

return new QueryCursorImpl<>(iter);
Copy link
Member

Choose a reason for hiding this comment

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

QueryCursorImpl<> -> QueryCursorImpl there is no any class to inject to the generic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


Integer part = qry.partition();

if (!lostParts.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

This code isn't covered with tests. Let's remove it and add test and code in a separate ticket

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lost partitions check removed.

}
}

if (qry.nodes().isEmpty())
Copy link
Member

Choose a reason for hiding this comment

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

This code is already starts on local node, why do we need this check?

Copy link
Contributor Author

@oleg-vlsk oleg-vlsk May 31, 2024

Choose a reason for hiding this comment

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

The IndexQueryLocalTest#testClientNodeReplicatedCache test (running a local index query on a client node) will fail if we don't do this check and throw a certain exception after it.

throw new IgniteException(new ClusterGroupEmptyException());

if (cctx.deploymentEnabled())
cctx.deploy().registerClasses(qry.scanFilter());
Copy link
Member

Choose a reason for hiding this comment

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

This code doesn't covered by tests. For what purpose do you need this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code removed.

@@ -3427,4 +3503,56 @@ IgniteBiPredicate<K, V> scanFilter() {
return scanFilter;
}
}

/** */
public static final class IndexQueryIterator<K, V> extends GridCloseableIteratorAdapter<Object> {
Copy link
Member

Choose a reason for hiding this comment

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

private

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to private.

return new IndexQueryIterator(idxQryRes.iter());
}
catch (Exception e) {
throw e;
Copy link
Member

Choose a reason for hiding this comment

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

Useless catch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Catch section removed.

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.

None yet

2 participants