-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
NIFI-11461 Improve User and Group Tenants Search #7181
Conversation
- Added searchTenants method to NiFiServiceFacade and removed unnecessary object creation - Updated TenantsResource to use delegated NiFiServiceFacade.searchTenants method - Changed autocomplete delay from default 300 ms to 500 ms
Will review... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @exceptionfactory! Looks great... I verified the new behavior but did notice a minor thing we may want to update prior to merging.
return createTenantEntity(tenant, permissions); | ||
} | ||
|
||
private TenantEntity createTenantEntity(final Group userGroup, final PermissionsDTO permissions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our EntityFactory
already contains methods for creating a TenantEntity
given a tenant
, revision
, and permissions
. Can we use that in favor of these new methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointer to EntityFactory
, I pushed an update removing the private methods and adjusting the stream function to make use of EntityFactory.createTenantEntity()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update @exceptionfactory. Nice work! +1
* NIFI-11461 Improved User and Group Tenants Search - Added searchTenants method to NiFiServiceFacade and removed unnecessary object creation - Updated TenantsResource to use delegated NiFiServiceFacade.searchTenants method - Changed autocomplete delay from default 300 ms to 500 ms * NIFI-11461 Adjusted implementation to use EntityFactory.createTenantEntity This closes #7181 (cherry picked from commit bdff3ab)
Summary
NIFI-11461 Improves the performance of the User and Group Tenants Search REST Resource method with the addition of a
searchTenants
method to theNiFiServiceFacade
.The previous implementation called
getUsers()
andgetUserGroups()
in the Tenants Resource, which requires retrieving all users and all group members before evaluating the query.The new implementation passes the query string to the
NiFiServiceFacade.searchTenants()
method and applies the filtering criteria prior to additional object creation. This approach reduces the number of method calls significantly for large numbers of users and groups.Additional changes include adjusting the user interface autocomplete delay from the default 300 ms to 500 ms, minimizing the number of HTTP requests in some scenarios.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000
NIFI-00000
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation