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



Do you also want to update PathUpdate.parsePath() to be consistent?


sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
Lines 219 (patched)
<https://reviews.apache.org/r/63645/#comment267759>

    This comment doesn't belong here - this is utility class which knows 
nothing about HMS - it is about string manipulation.
    
    The relevant omment should say that leading slashes are ignored, so 
    
    /a/b/c beomes {a, b, c}



sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
Line 219 (original), 224 (patched)
<https://reviews.apache.org/r/63645/#comment267756>

    This function now does more then split, so it should be updated and 
documented properly



sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
Line 220 (original), 226 (patched)
<https://reviews.apache.org/r/63645/#comment267760>

    Do we really need to chck for null? Can we specify the non-null value as a 
contract?



sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
Lines 229 (patched)
<https://reviews.apache.org/r/63645/#comment267755>

    This function isn't used by anything so why make it public? I suggest to 
just inline it in splitPath()
    
    This whole function can be replaced with
    path.replaceAll("^/+", "")



sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
Lines 230 (patched)
<https://reviews.apache.org/r/63645/#comment267762>

    We don't need to collapse slashes any more



sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
Lines 232 (patched)
<https://reviews.apache.org/r/63645/#comment267761>

    We don't need to replace all since we do path.split("/+"). We only need to 
remove leading slashes, so this check should be changed to startsWith("/")


- Alexander Kolbasov


On Nov. 7, 2017, 9:16 p.m., Arjun Mishra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63645/
> -----------------------------------------------------------
> 
> (Updated Nov. 7, 2017, 9:16 p.m.)
> 
> 
> Review request for sentry, Sergio Pena and Vadim Spector.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> When retrieving full path image update, we split a path by "/" and create HMS 
> Path entries. However, the leading "/" presence will cause issues because on 
> splitting the value at index 0 will be empty. This will affect the creation 
> of HMS path entries.
> 
> 
> Diffs
> -----
> 
>   
> sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/utils/PathUtils.java
>  cef8bd734 
>   
> sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java
>  cf83e7796 
> 
> 
> Diff: https://reviews.apache.org/r/63645/diff/1/
> 
> 
> Testing
> -------
> 
> mvn -f sentry-provider/sentry-provider-db/pom.xml test -Dtest=TestSentryStore
> 
> 
> Thanks,
> 
> Arjun Mishra
> 
>

Reply via email to