> On Aug. 21, 2018, 8:34 p.m., Na Li wrote: > > sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > > Line 2239 (original), 2280 (patched) > > <https://reviews.apache.org/r/61863/diff/4/?file=2075761#file2075761line2280> > > > > can you reduce overhead by > > > > result.add(convertToTsentryRole( role, mgroup.getGroupName))? > > > > private TSentryRole convertToTSentryRole(MSentryRole mSentryRole, > > String groupName) { > > String roleName = mSentryRole.getRoleName().intern(); > > > > Set<TSentryGroup> sentryGroups = new HashSet<>(1); > > sentryGroups.add(new TSentryGroup(groupName.intern()); > > > > > > > > return new TSentryRole(roleName, sentryGroups, > > EMPTY_GRANTOR_PRINCIPAL); > > } > > > > In this way, you don't need to need to mSentryRole.getGroups(), which > > should cause another call to DB to get the groups of a role. > > > > In this way, we only have DB access to get a group and its roles. No > > fetching of privileges and other groups of each role that is associated > > with the specific group > > Arjun Mishra wrote: > I wasn't sure if all groups needed to be fetched for that role. I think I > could do that in a different ticket. Let me know if you agree
agree. We can investigate this in another jira - Na ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61863/#review207690 ----------------------------------------------------------- On Aug. 21, 2018, 7:19 p.m., Arjun Mishra wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61863/ > ----------------------------------------------------------- > > (Updated Aug. 21, 2018, 7:19 p.m.) > > > Review request for sentry, kalyan kumar kalvagadda, Na Li, and Sergio Pena. > > > Repository: sentry > > > Description > ------- > > Right now when we get privileges from sentry, we pass in a provider like set > of groups. Then we create a MSentryGroup object for each group and then get > roles using the .getRoles() method. This is bad since we only need the > roleNames for the group and not the entire Role object. > Instead running a SQL like query and just getting roleNames will drastically > improve performance > > > Diffs > ----- > > > sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > 0ef6a208f > > > Diff: https://reviews.apache.org/r/61863/diff/4/ > > > Testing > ------- > > > Thanks, > > Arjun Mishra > >