> 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
> > Lines 365 (patched)
> > <https://reviews.apache.org/r/61863/diff/4/?file=2075761#file2075761line365>
> >
> >     privileges is in default fetch group of MSentryUser
> >     
> >     <class name="MSentryUser" identity-type="datastore" table="SENTRY_USER" 
> > detachable="true">
> >           <datastore-identity>
> >             <column name="USER_ID"/>
> >           </datastore-identity>
> >           <field name="userName">
> >             <column name="USER_NAME" length="128" jdbc-type="VARCHAR"/>
> >             <index name="SentryUserName" unique="true"/>
> >           </field>
> >           <field name = "createTime">
> >             <column name = "CREATE_TIME" jdbc-type="BIGINT"/>
> >           </field>
> >     
> >           <field name="roles" mapped-by="users">
> >              <collection 
> > element-type="org.apache.sentry.provider.db.service.model.MSentryRole"/>
> >           </field>
> >     
> >           <field name = "privileges" table="SENTRY_USER_DB_PRIVILEGE_MAP" 
> > default-fetch-group="true">
> 
> Arjun Mishra wrote:
>     That means the attributes of privileges will be fetched in 
> default-fetch-group, but not the privilege object when fetching sentry_users

agree. Putting "privileges" in default fetch group may only let "privileges" to 
be fetched automatically, but does not allow the content of each privilege to 
be fetched. We are dealing 3 tables here, SENTRY_USER, 
SENTRY_USER_DB_PRIVILEGE_MAP, and SENTRY_DB_PRIVILEGE.


- 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
> 
>

Reply via email to