[KYUUBI #7079] Improve performance of AccessRequest initialization#7081
[KYUUBI #7079] Improve performance of AccessRequest initialization#7081wForget wants to merge 18 commits into
Conversation
| * @param argClasses the classes of the arguments | ||
| * @return an unbound method that can be invoked later | ||
| */ | ||
| def getMethod(clz: Class[_], methodName: String, argClasses: Class[_]*): UnboundMethod = { |
There was a problem hiding this comment.
this does not simplify much code, can we inline it?
There was a problem hiding this comment.
this does not simplify much code, can we inline it?
Makes sense, changed.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7081 +/- ##
=======================================
Coverage 0.00% 0.00%
=======================================
Files 697 700 +3
Lines 43203 43457 +254
Branches 5854 5887 +33
=======================================
- Misses 43203 43457 +254 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| private def getUserGroupsFromUserStore(user: UserGroupInformation): Option[JSet[String]] = { | ||
| private lazy val userGroupMappingOpt: Option[JHashMap[String, JSet[String]]] = { |
There was a problem hiding this comment.
I'm not sure if this is safe to cache
There was a problem hiding this comment.
I'm not sure if this is safe to cache
userGroupMapping may be updated by RangerUserStoreRefresher, I will only cache reflect methods
|
|
||
| private val getRolesFromUserAndGroupsMethod: Option[UnboundMethod] = | ||
| getMethod( | ||
| SparkRangerAdminPlugin.getClass, |
There was a problem hiding this comment.
| SparkRangerAdminPlugin.getClass, | |
| classOf[SparkRangerAdminPlugin], |
There was a problem hiding this comment.
SparkRangerAdminPlugin is an object and does not seem to work with classOf.
|
|
||
| private lazy val getUserGroupMappingMethod: Option[UnboundMethod] = | ||
| getMethod( | ||
| Class.forName("org.apache.ranger.plugin.util.RangerUserStore"), |
There was a problem hiding this comment.
it's located at ranger-plugins-common, should be always accessible?
There was a problem hiding this comment.
it's located at
ranger-plugins-common, should be always accessible?
I don't get your point, but the logic here seems to be consistent with previous.
There was a problem hiding this comment.
I see, it's a new feature of Ranger 2.1, we must use reflection as long as we support lower Ranger versions
…kyuubi/plugin/spark/authz/ranger/AccessRequest.scala Co-authored-by: Cheng Pan <pan3793@gmail.com>
…kyuubi/plugin/spark/authz/ranger/AccessRequest.scala Co-authored-by: Cheng Pan <pan3793@gmail.com>
…/apache/kyuubi/plugin/spark/authz/ranger/AccessRequest.scala" This reverts commit 686c45b.
…/apache/kyuubi/plugin/spark/authz/ranger/AccessRequest.scala" This reverts commit 99e0bd3.
|
Thanks for the PR! This PR is being closed due to inactivity. This isn't a judgement on the merit of the PR in any way. If this is still an issue with the latest version of Kyuubi, please reopen it and ask a committer to remove the Stale tag! Thank you for using Kyuubi! |
Why are the changes needed?
Improve performance of authz rules.
Constantize some properties to reduce object creation:
RuleHelper.ugi(different sparkSession may have different authz ugi)closes #7079
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
No