You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Vaibhav Joshi (Jira)" <ji...@apache.org> on 2023/04/05 09:59:00 UTC

[jira] [Comment Edited] (CALCITE-5581) Implement Basic client side load balancing in Avatica Driver

    [ https://issues.apache.org/jira/browse/CALCITE-5581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17708242#comment-17708242 ] 

Vaibhav Joshi edited comment on CALCITE-5581 at 4/5/23 9:58 AM:
----------------------------------------------------------------

*Summary of the feature*

In this ticket we have added following new properties to the driver to support basic client side load balancing.

 
||Property Name||Description||
|*[use_client_side_lb|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#use_client_side_lb]*|Enables the client side load-balancing
_Default: false_|
|{*}[lb_urls|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_urls]{*}{*}{{*}}|List of URLs in a comma separated format, for example "URL1,URL2...URLn", to be used by the client side load balancer.
Depending on the load balancing strategy, load balancer selects one of the URLs from the list. 
_Default: ""_ |
|*[lb_strategy|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_strategy]*|The load balancing strategy to be used by the client side load balancer. It must be a fully qualified Java class name which implements {{{}org.apache.calcite.avatica.ha.LBStrategy{}}}. Out of the box we have provided two implementations {{org.apache.calcite.avatica.ha.RandomSelectLBStrategy, }} {{org.apache.calcite.avatica.ha.RoundRobinLBStrategy}} and {{org.apache.calcite.avatica.ha.ShuffledRoundRobinLBStrategy }}which you can use as a load balancing strategies. 
{_}Default{_}: {{{}org.apache.calcite.avatica.ha.{}}}{{{}ShuffledRoundRobinLBStrategy{}}}{{{}{}}}|
|*[lb_connection_failover_retries|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_connection_failover_retries]*|Number of times that the load balancer tries to retry the connection with another URL (fail-over). When the connection fails, load balancer retries the connection with another URL, chosen by the load balancing strategy
_Default:3_|
|*[lb_connection_failover_sleep_time|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_connection_failover_sleep_time]*|The amount of time in milliseconds that the load balancer sleeps before attempting the next connection failover retry.
_Default: 1000_|
|*[http_connection_timeout|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#http_connection_timeout]*|Timeout in milliseconds for the connection between the Avatica HTTP client and server
_Default: 18000 (3 Minutes)_|

 

 

The sample URL will look like below
{code:java}
jdbc:phoenix:thin:url=http://host1:port1;
serialization=PROTOBUF;
authentication=SPNEGO;
principal=kbPrincipal;
keytab=/usr/keytabs/kbPrincipal.keytab;
truststore=/usr/truststore.jks;
truststore_password=0123456789;
serialization=PROTOBUF
use_client_side_lb=true;
lb_urls=http://host1:port1,http://host2:port2,http://host3:port3;
lb_strategy=org.apache.calcite.avatica.ha.RoundRobinLBStrategy;
lb_connection_failover_sleep_time=3000;
lb_connection_failover_retries=3;
http_connection_timeout=5000; {code}
 


was (Author: JIRAUSER291813):
*Summary of the feature*

In this ticket we have added following new properties to the driver to support basic client side load balancing.

 
||Property Name||Description||
|*[use_client_side_lb|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#use_client_side_lb]*|Enables the client side load-balancing
_Default: false_|
|{*}[lb_urls|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_urls]{*}{*}{*}|List of URLs in a comma separated format, for example "URL1,URL2...URLn", to be used by the client side load balancer.
Depending on the load balancing strategy, load balancer selects one of the URLs from the list. 
_Default: ""_ |
|*[lb_strategy|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_strategy]*|The load balancing strategy to be used by the client side load balancer. It must be a fully qualified Java class name which implements {{{}org.apache.calcite.avatica.ha.LBStrategy{}}}. Out of the box we have provided two implementations {{org.apache.calcite.avatica.ha.RandomSelectLBStrategy}} and 
{{org.apache.calcite.avatica.ha.RoundRobinLBStrategy}} which you can use as load balancing strategies. 
{_}Default{_}: {{org.apache.calcite.avatica.ha.RandomSelectLBStrategy}}|
|*[lb_connection_failover_retries|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_connection_failover_retries]*|Number of times that the load balancer tries to retry the connection with another URL (fail-over). When the connection fails, load balancer retries the connection with another URL, chosen by the load balancing strategy
_Default:3_|
|*[lb_connection_failover_sleep_time|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#lb_connection_failover_sleep_time]*|The amount of time in milliseconds that the load balancer sleeps before attempting the next connection failover retry.
_Default: 1000_|
|*[http_connection_timeout|http://localhost:63342/markdownPreview/819017048/markdown-preview-index-410834764.html?_ijt=624n55lnnqdcd7drlq8buf6qph#http_connection_timeout]*|Timeout in milliseconds for the connection between the Avatica HTTP client and server
_Default: 18000 (3 Minutes)_|

 

 

The sample URL will look like below
{code:java}
jdbc:phoenix:thin:url=http://host1:port1;
serialization=PROTOBUF;
authentication=SPNEGO;
principal=kbPrincipal;
keytab=/usr/keytabs/kbPrincipal.keytab;
truststore=/usr/truststore.jks;
truststore_password=0123456789;
serialization=PROTOBUF
use_client_side_lb=true;
lb_urls=http://host1:port1,http://host2:port2,http://host3:port3;
lb_strategy=org.apache.calcite.avatica.ha.RoundRobinLBStrategy;
lb_connection_failover_sleep_time=3000;
lb_connection_failover_retries=3;
http_connection_timeout=5000; {code}
 

> Implement Basic client side load balancing in Avatica Driver
> ------------------------------------------------------------
>
>                 Key: CALCITE-5581
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5581
>             Project: Calcite
>          Issue Type: New Feature
>          Components: avatica
>    Affects Versions: 1.33.0
>            Reporter: Vaibhav Joshi
>            Assignee: Vaibhav Joshi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Avatica Basic client side load balancing.docx
>
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> Implement mechanism to support Client side load balancing by configuring connection properties for load balancing  
> {code:java}
> jdbc:phoenix:thin:
> url=https://<host>:<port>;
> serialization=PROTOBUF;
> authentication=BASIC;
> avatica_user=<userName>;
> avatica_password=<userPw>
> useClientSideLB: [true/false]
> lbStrategy: [RandomDistribution/Sequential/RoundRobin]
> lbURLs: <comma separated URls e.g. URL1, URL2,URL3,...URLn> {code}
> Client should connect to any of the URLs specified in lbURLs ( depending on LB strategy selected).  Please refer to [^Avatica Basic client side load balancing.docx]for more details
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)