You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by cao zhiqiang <lf...@163.com> on 2021/08/24 07:47:08 UTC

Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

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

Review request for ranger and Madhan Neethiraj.


Bugs: RANGER-3378
    https://issues.apache.org/jira/browse/RANGER-3378


Repository: ranger


Description
-------

RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 


Diff: https://reviews.apache.org/r/73540/diff/1/


Testing
-------

The getAsString function take mush less more than before.


Thanks,

cao zhiqiang


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73540/#review223403
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On Aug. 26, 2021, 2:57 a.m., cao zhiqiang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73540/
> -----------------------------------------------------------
> 
> (Updated Aug. 26, 2021, 2:57 a.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-3378
>     https://issues.apache.org/jira/browse/RANGER-3378
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
>   hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java 7b2882c40 
> 
> 
> Diff: https://reviews.apache.org/r/73540/diff/3/
> 
> 
> Testing
> -------
> 
> The getAsString function take mush less more than before.
> 
> 
> Thanks,
> 
> cao zhiqiang
> 
>


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by cao zhiqiang <lf...@163.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73540/
-----------------------------------------------------------

(Updated 八月 26, 2021, 2:57 a.m.)


Review request for ranger and Madhan Neethiraj.


Bugs: RANGER-3378
    https://issues.apache.org/jira/browse/RANGER-3378


Repository: ranger


Description
-------

RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
  hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java 7b2882c40 


Diff: https://reviews.apache.org/r/73540/diff/3/

Changes: https://reviews.apache.org/r/73540/diff/2-3/


Testing
-------

The getAsString function take mush less more than before.


Thanks,

cao zhiqiang


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by cao zhiqiang <lf...@163.com>.

> On 八月 25, 2021, 4:47 p.m., Abhay Kulkarni wrote:
> > agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java
> > Lines 122 (patched)
> > <https://reviews.apache.org/r/73540/diff/2/?file=2252270#file2252270line122>
> >
> >     Consider making get/setStringifiedCacheKeyValue() APIs protected (instead of public).

ok.


- cao


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


On 八月 26, 2021, 2:57 a.m., cao zhiqiang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73540/
> -----------------------------------------------------------
> 
> (Updated 八月 26, 2021, 2:57 a.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-3378
>     https://issues.apache.org/jira/browse/RANGER-3378
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
>   hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java 7b2882c40 
> 
> 
> Diff: https://reviews.apache.org/r/73540/diff/3/
> 
> 
> Testing
> -------
> 
> The getAsString function take mush less more than before.
> 
> 
> Thanks,
> 
> cao zhiqiang
> 
>


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73540/#review223395
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java
Lines 122 (patched)
<https://reviews.apache.org/r/73540/#comment312461>

    Consider making get/setStringifiedCacheKeyValue() APIs protected (instead of public).


- Abhay Kulkarni


On Aug. 25, 2021, 2:44 p.m., cao zhiqiang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73540/
> -----------------------------------------------------------
> 
> (Updated Aug. 25, 2021, 2:44 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-3378
>     https://issues.apache.org/jira/browse/RANGER-3378
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
>   hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java 7b2882c40 
> 
> 
> Diff: https://reviews.apache.org/r/73540/diff/2/
> 
> 
> Testing
> -------
> 
> The getAsString function take mush less more than before.
> 
> 
> Thanks,
> 
> cao zhiqiang
> 
>


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by cao zhiqiang <lf...@163.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73540/
-----------------------------------------------------------

(Updated 八月 25, 2021, 2:44 p.m.)


Review request for ranger and Madhan Neethiraj.


Bugs: RANGER-3378
    https://issues.apache.org/jira/browse/RANGER-3378


Repository: ranger


Description
-------

RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
  hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java 7b2882c40 


Diff: https://reviews.apache.org/r/73540/diff/2/

Changes: https://reviews.apache.org/r/73540/diff/1-2/


Testing
-------

The getAsString function take mush less more than before.


Thanks,

cao zhiqiang


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by cao zhiqiang <lf...@163.com>.

> On 八月 24, 2021, 2:10 p.m., Madhan Neethiraj wrote:
> >

OK, Thank you. I have modified according to your suggestion.


- cao


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


On 八月 25, 2021, 2:44 p.m., cao zhiqiang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73540/
> -----------------------------------------------------------
> 
> (Updated 八月 25, 2021, 2:44 p.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-3378
>     https://issues.apache.org/jira/browse/RANGER-3378
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
>   hdfs-agent/src/main/java/org/apache/ranger/authorization/hadoop/RangerHdfsAuthorizer.java 7b2882c40 
> 
> 
> Diff: https://reviews.apache.org/r/73540/diff/2/
> 
> 
> Testing
> -------
> 
> The getAsString function take mush less more than before.
> 
> 
> Thanks,
> 
> cao zhiqiang
> 
>


Re: Review Request 73540: RANGER-3378 getAsString spend too much time, should be replace to improve plugin performance

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/73540/#review223381
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java
Lines 40 (patched)
<https://reviews.apache.org/r/73540/#comment312440>

    RangerAccessResourceImpl is plugin-agnostic class; please avoid plugin specific flags - like hdfsResource here.
    
    For HDFS resource specific optimizations, consider overriding RangerHdfsResource.getAsString() as shown below:
    
      class RangerHdfsResource extends RangerAccessResourceImpl {
        ...
        @Override
    	public String getAsString() {
          String ret = super.getStringifiedValue();
          
          if (ret == null) {
            ret = Objects.toString(super.getValue(RangerHdfsAuthorizer.KEY_RESOURCE_PATH));
            
            super.setStringifiedValue(ret);
          }
    
          return ret;
        }
        ...
      }


- Madhan Neethiraj


On Aug. 24, 2021, 7:47 a.m., cao zhiqiang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/73540/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2021, 7:47 a.m.)
> 
> 
> Review request for ranger and Madhan Neethiraj.
> 
> 
> Bugs: RANGER-3378
>     https://issues.apache.org/jira/browse/RANGER-3378
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RangerAccessResourceImpl.getAsString function take too much time. We should replace it to improve performance for hdfs.
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerAccessResourceImpl.java 93810ae21 
> 
> 
> Diff: https://reviews.apache.org/r/73540/diff/1/
> 
> 
> Testing
> -------
> 
> The getAsString function take mush less more than before.
> 
> 
> Thanks,
> 
> cao zhiqiang
> 
>