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



sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/HASentryPolicyServiceClientImpl.java
<https://reviews.apache.org/r/25980/#comment98204>

    The current approach requires an wrapper for every Sentry client method. 
When we add new methods, it will require to add a wrapper in here as well. 
    Have you considered using InvocationHandler for the retry wrapper ? It 
would make adding new methods in the client interface simpler.
    If there's no specific reason for not using InvocationHandler, then we 
might want to log a followup ticket to refactor this module.



sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/HASentryPolicyServiceClientImpl.java
<https://reviews.apache.org/r/25980/#comment98206>

    Do we need to check for a timeout here or the retry policy (in HAContext ?) 
will take care of it ?



sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/HASentryPolicyServiceClientImpl.java
<https://reviews.apache.org/r/25980/#comment98198>

    In secure connection the client would need the kerberos principal of the 
server. How do we handle that case ?



sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/AbstractTestWithHADbProvider.java
<https://reviews.apache.org/r/25980/#comment98209>

    Can we move the HA specific changes in the AbstractTestWithDbProvider ? 
That would make it simpler to run the existing tests on real cluster with HA


- Prasad Mujumdar


On Oct. 9, 2014, 5:48 a.m., Sun Dapeng wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25980/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 5:48 a.m.)
> 
> 
> Review request for sentry, Arun Suresh, Lenni Kuff, Prasad Mujumdar, and 
> Sravya Tirukkovalur.
> 
> 
> Bugs: SENTRY-464
>     https://issues.apache.org/jira/browse/SENTRY-464
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> * Add service register in **SentryPolicyStoreProcessor**
> * Add **HASentryPolicyServiceClientImpl** as a HA implementation for 
> SentryPolicyServiceClient, it can select active node which registered in 
> Zookeeper
> * Add **doOperationAndRetry** , use **SentryPolicyServiceClientDefaultImpl** 
> as a field, this make all HA method can reuse the same logic for retry.
> ````java
>    private <T> T doOperationAndRetry(SentryOperation<T> sentryOption) throws 
> SentryUserException {
>     while (true) {
>       try {
>         return sentryOption.doOperation();
>       } catch (SentryUserException e) {
>         throw e;
>       } catch (Exception e) {
>         LOGGER.warn(THRIFT_EXCEPTION_MESSAGE
>             + ": Error in connect current service, will retry other 
> service.", e);
>         try {
>           renewSentryClient();
>         } catch (IOException e1) {
>           throw new SentryUserException(e1.getMessage(),e1.getCause());
>         }
>       }
>     }
>   }
> ````
> 
> 
> Diffs
> -----
> 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/HASentryPolicyServiceClientImpl.java
>  PRE-CREATION 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java
>  e3cdfc2 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryService.java
>  6843e80 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/SentryServiceClientFactory.java
>  11545a5 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/AbstractTestWithHADbProvider.java
>  PRE-CREATION 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/ha/TestPrivilegeWithHAGrantOption.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/25980/diff/
> 
> 
> Testing
> -------
> 
> The addition UnitTest is used for test client reconnect, other UnitTest 
> passed in local
> 
> 
> Thanks,
> 
> Sun Dapeng
> 
>

Reply via email to