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




sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
 (line 178)
<https://reviews.apache.org/r/52526/#comment220693>

    this is one of the constructor in this class.
    Do you mean add rand as a memeber var in this class?
    but rand is only used in this constructor.



sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/ThriftUtil.java
 (line 118)
<https://reviews.apache.org/r/52526/#comment220702>

    yes. Good point!



sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java
 (line 146)
<https://reviews.apache.org/r/52526/#comment220707>

    There are two different modes for clients, PoolClientInvocationHandler is 
used for pool mode, while SentryPolicyServiceClientDefaultImpl is for non-pool 
mode.



sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java
 (line 178)
<https://reviews.apache.org/r/52526/#comment220711>

    There are two modes for clients and we may not combine the retry logic 
together. Here in the pool mode, all the availble connections will be added in 
a pool, which will be shared by multiple threads. And all threads will share 
the state of the connections, which is curFreshestEndpointIdx and endpoints in 
the code. If thread A failed to connect to nth server, then thread B after A 
will skip n and try n+1.


- Li Li


On Oct. 7, 2016, 12:30 a.m., Li Li wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/52526/
> -----------------------------------------------------------
> 
> (Updated Oct. 7, 2016, 12:30 a.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, Anne Yu, Hao Hao, and Sravya 
> Tirukkovalur.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> Add retry logic for non-pool model.
> 
> 
> Diffs
> -----
> 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClientDefaultImpl.java
>  4f42a51b1449fe15f856ba252103e66383e175d7 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/ThriftUtil.java
>  3a96d0b124c00efc99cef256c72c25f5c6168007 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/PoolClientInvocationHandler.java
>  842d5cafb06910fcbe6c53002f2101ec5b890a9e 
>   
> sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/ServiceConstants.java
>  abc3f58d21bb774427a34399b6e9f51a37ba51db 
>   
> sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestPoolClientInvocationHandler.java
>  5b0e12bbf12510d8d424aa2b7f51076a913234c5 
> 
> Diff: https://reviews.apache.org/r/52526/diff/
> 
> 
> Testing
> -------
> 
> In non-pool model, for each full retry we will cycle through all available 
> sentry servers. Before each full retry, we will shuffle the server list, and 
> after each full retry, we will have a small random sleep.
> 
> 
> Thanks,
> 
> Li Li
> 
>

Reply via email to