Skip to content

Conversation

@alex-plekhanov
Copy link
Contributor

…iews filtrable

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.

* Generated by {@code org.apache.ignite.codegen.SystemViewRowAttributeWalkerGenerator}.
* {@link SqlQueryHistoryView} attributes walker.
*
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a generated code, this view was somehow changed after generation and now every time SystemViewRowAttributeWalkerGenerator is called this change is reappears again.

List<MetastorageView> data = new ArrayList<>();

iterate("", (key, val) -> data.add(new MetastorageView(key, val == null || !val.getClass().isArray()
iterate(name, (key, val) -> data.add(new MetastorageView(key, val == null || !val.getClass().isArray()
Copy link
Contributor

Choose a reason for hiding this comment

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

iterate finds all keys with the given prefix. So if we pass something like rolling.upgrade, it will also return rolling.upgrade.version.

This could be confusing, especially since in org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor#nodeAttributeViewSupplier we look up an attribute only by the exact attrName

  1. Do we have keys where one key is prefix of another key?
  2. Will such behavior be clear for user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We never state that filter is for exact match. So, formally, we are not violating the contract. It can be exect value, for some views, it can be prefix for another. In SQL, where contract required that filtering return exact value - there is post filtration based on condition after lookup by filter. So filtering it's a good way to narrow the scope.

  1. I don't know, but I think it's possible.
  2. I'm not sure anyone is using iterators direcly, views filtration are made usually using SQL, in SQL this is not an issue. But ok, I think we can fix it and make behaviour the same for different views.

Fixed.

@sonarqubecloud
Copy link

Copy link
Contributor

@chesnokoff chesnokoff left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants