You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sentry.apache.org by Colin Ma <ju...@intel.com> on 2016/02/22 03:50:03 UTC

Review Request 43818: SENTRY-1091: Create Model for specific components

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43818/
-----------------------------------------------------------

Review request for sentry.


Repository: sentry


Description
-------

For new external components, it should implement Model and BitFieldActionFactory.
Implement Model and BitFieldActionFactory for Hive, Sqoop, Solr, Index.


Diffs
-----

  sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java PRE-CREATION 
  sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java PRE-CREATION 
  sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java PRE-CREATION 
  sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java PRE-CREATION 
  sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java PRE-CREATION 

Diff: https://reviews.apache.org/r/43818/diff/


Testing
-------


Thanks,

Colin Ma


Re: Review Request 43818: SENTRY-1091: Create Model for specific components

Posted by Dapeng Sun <da...@intel.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43818/#review120267
-----------------------------------------------------------


Ship it!




Ship It!

- Dapeng Sun


On 二月 23, 2016, 1:55 p.m., Colin Ma wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43818/
> -----------------------------------------------------------
> 
> (Updated 二月 23, 2016, 1:55 p.m.)
> 
> 
> Review request for sentry.
> 
> 
> Bugs: SENTRY-1091
>     https://issues.apache.org/jira/browse/SENTRY-1091
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> For new external components, it should implement Model and BitFieldActionFactory.
> Implement Model and BitFieldActionFactory for Hive, Sqoop, Solr, Index.
> 
> 
> Diffs
> -----
> 
>   sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java PRE-CREATION 
>   sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43818/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Colin Ma
> 
>


Re: Review Request 43818: SENTRY-1091: Create Model for specific components

Posted by Colin Ma <ju...@intel.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43818/
-----------------------------------------------------------

(Updated Feb. 23, 2016, 5:55 a.m.)


Review request for sentry.


Bugs: SENTRY-1091
    https://issues.apache.org/jira/browse/SENTRY-1091


Repository: sentry


Description
-------

For new external components, it should implement Model and BitFieldActionFactory.
Implement Model and BitFieldActionFactory for Hive, Sqoop, Solr, Index.


Diffs (updated)
-----

  sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java PRE-CREATION 
  sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java PRE-CREATION 
  sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java PRE-CREATION 
  sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java PRE-CREATION 
  sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java PRE-CREATION 

Diff: https://reviews.apache.org/r/43818/diff/


Testing
-------


Thanks,

Colin Ma


Re: Review Request 43818: SENTRY-1091: Create Model for specific components

Posted by Colin Ma <ju...@intel.com>.

> On Feb. 23, 2016, 2:10 a.m., Dapeng Sun wrote:
> > sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java, line 57
> > <https://reviews.apache.org/r/43818/diff/1/?file=1263761#file1263761line57>
> >
> >     return null?

The following is the useage for this method in CommonPrivilege, retrun null means the action is not supported:
```
  private boolean impliesAction(String policyValue, String requestValue,
                                BitFieldActionFactory bitFieldActionFactory) {
    BitFieldAction currentAction = bitFieldActionFactory.getActionByName(policyValue);
    BitFieldAction requestAction = bitFieldActionFactory.getActionByName(requestValue);
    // the action in privilege is not supported
    if (currentAction == null || requestAction == null) {
      return false;
    }
    return currentAction.implies(requestAction);
  }
```


- Colin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43818/#review120240
-----------------------------------------------------------


On Feb. 22, 2016, 2:50 a.m., Colin Ma wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43818/
> -----------------------------------------------------------
> 
> (Updated Feb. 22, 2016, 2:50 a.m.)
> 
> 
> Review request for sentry.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> For new external components, it should implement Model and BitFieldActionFactory.
> Implement Model and BitFieldActionFactory for Hive, Sqoop, Solr, Index.
> 
> 
> Diffs
> -----
> 
>   sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java PRE-CREATION 
>   sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43818/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Colin Ma
> 
>


Re: Review Request 43818: SENTRY-1091: Create Model for specific components

Posted by Dapeng Sun <da...@intel.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43818/#review120240
-----------------------------------------------------------



Thank Colin, I left some comments.


sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java (line 24)
<https://reviews.apache.org/r/43818/#comment181675>

    Better to add some comments before the class



sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java (line 37)
<https://reviews.apache.org/r/43818/#comment181662>

    Where is action **Some**, and could you add some comments for ALL and ALL_STAR



sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java (line 57)
<https://reviews.apache.org/r/43818/#comment181678>

    return null?



sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java (line 35)
<https://reviews.apache.org/r/43818/#comment181677>

    It seem the line is too long, can we use static import to reduce it?



sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java (line 53)
<https://reviews.apache.org/r/43818/#comment181669>

    How about improve the thread safety here or "lazy initialization"?



sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java (line 34)
<https://reviews.apache.org/r/43818/#comment181671>

    I didn't find **IndexerActionFactory**



sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java (line 50)
<https://reviews.apache.org/r/43818/#comment181668>

    How about improve the thread safety here or "lazy initialization"?



sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java (line 34)
<https://reviews.apache.org/r/43818/#comment181672>

    where is SearchActionFactory



sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java (line 51)
<https://reviews.apache.org/r/43818/#comment181665>

    How about improve the thread safety here or "lazy initialization"?



sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java (line 34)
<https://reviews.apache.org/r/43818/#comment181674>

    where is SqoopActionFactory



sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java (line 53)
<https://reviews.apache.org/r/43818/#comment181666>

    How about improve the thread safety here or "lazy initialization"?


- Dapeng Sun


On 二月 22, 2016, 10:50 a.m., Colin Ma wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43818/
> -----------------------------------------------------------
> 
> (Updated 二月 22, 2016, 10:50 a.m.)
> 
> 
> Review request for sentry.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> For new external components, it should implement Model and BitFieldActionFactory.
> Implement Model and BitFieldActionFactory for Hive, Sqoop, Solr, Index.
> 
> 
> Diffs
> -----
> 
>   sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HiveActionFactory.java PRE-CREATION 
>   sentry-core/sentry-core-model-db/src/main/java/org/apache/sentry/core/model/db/HivePrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/IndexerPrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/SearchPrivilegeModel.java PRE-CREATION 
>   sentry-core/sentry-core-model-sqoop/src/main/java/org/apache/sentry/core/model/sqoop/SqoopPrivilegeModel.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/43818/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Colin Ma
> 
>