----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61863/#review184334 -----------------------------------------------------------
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 1811 (original), 1811 (patched) <https://reviews.apache.org/r/61863/#comment260460> Can we use pm.setDetachAllOnCommit(false); here? sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 1822 (original), 1822 (patched) <https://reviews.apache.org/r/61863/#comment260459> What does this function do? Please add documentation. The code is a bit non-trivial, please explain what you are doing and why. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 1823 (original), 1823 (patched) <https://reviews.apache.org/r/61863/#comment260461> Do we need results of the query after close? sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Lines 1825 (patched) <https://reviews.apache.org/r/61863/#comment260462> What is the goal of this? Previously in this case we returned an empty set. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Lines 1828 (patched) <https://reviews.apache.org/r/61863/#comment260463> `sentrGroup` is a weird name. Of course this is sentry, so group is a perfect name. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Lines 1833 (patched) <https://reviews.apache.org/r/61863/#comment260464> Do we need to use FetchGroups here? Why do you think it is beneficial? sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Lines 1839 (patched) <https://reviews.apache.org/r/61863/#comment260465> Just use HashSet<>(result) sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java Line 1808 (original), 1808 (patched) <https://reviews.apache.org/r/61863/#comment260466> You should also have a test with null groups and with empty groups. sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java Lines 1811 (patched) <https://reviews.apache.org/r/61863/#comment260467> how about number of groups? You are testing with a single group. sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java Lines 1818 (patched) <https://reviews.apache.org/r/61863/#comment260468> Here and above, use new HashSet<>() instead of Sets.newHashSet() sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java Lines 1842 (patched) <https://reviews.apache.org/r/61863/#comment260469> Do you need to remove all these roles at the end of the test? Other tests may fail because some role exists. - Alexander Kolbasov On Aug. 31, 2017, 9:55 p.m., Arjun Mishra wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61863/ > ----------------------------------------------------------- > > (Updated Aug. 31, 2017, 9:55 p.m.) > > > Review request for sentry, Alexander Kolbasov, Vamsee Yarlagadda, and Vadim > Spector. > > > 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. However, DataNucleus takes too long and > the fetch doesn't seem to be lazy. 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-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > d7acaea7c > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java > 8f60b5801 > > > Diff: https://reviews.apache.org/r/61863/diff/3/ > > > Testing > ------- > > > Thanks, > > Arjun Mishra > >