[jira] [Commented] (CALCITE-2704) Multilingual decoded problem

2019-06-20 Thread Leo Tu (JIRA)


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

Leo Tu commented on CALCITE-2704:
-

I add test code at: [https://github.com/apache/calcite-avatica/pull/85]

> Multilingual decoded problem
> 
>
> Key: CALCITE-2704
> URL: https://issues.apache.org/jira/browse/CALCITE-2704
> Project: Calcite
>  Issue Type: Bug
>  Components: avatica
>Affects Versions: avatica-1.11.0, avatica-1.12.0, avatica-1.13.0
>Reporter: pufan
>Priority: Blocker
>  Labels: pull-request-available
> Fix For: avatica-1.16.0
>
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> When we execute SQL with Chinese characters, we find that the server parses 
> it in gibberish.
> After checking the code, we found that:
> org.apache.calcite.avatica.server.AvaticaJsonHandler.java line 109:
> {code:java}
> //The readFully method USES utf-8 encoding internally.
> rawRequest = AvaticaUtils.readFully(inputStream, buffer);
> {code}
> But in the org.apache.calcite.avatica.server.AvaticaJsonHandler.java line 116:
> {code:java}
> // Decoded using iso-8859-1 Cause Chinese garble.
> final String jsonRequest = new String(rawRequest.getBytes("ISO-8859-1"), 
> "UTF-8");
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CALCITE-3134) Avatica Remote JDBC HttpClient may run Infinite loop

2019-06-18 Thread Leo Tu (JIRA)


 [ 
https://issues.apache.org/jira/browse/CALCITE-3134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leo Tu updated CALCITE-3134:

Description: 
The implementation of AvaticaHttpClient
 * org.apache.calcite.avatica.remote.AvaticaHttpClientImpl

or 
 * org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl

 

"while (true) ... 503 continue"

i have face that client run forever when HTTP code 503.

(i.e, Nginx proxy gateway failed return 503 code always)

 

 

--  -red color-  

{color:#ff}*public* *byte*[] send(*byte*[] request){color} {

    {color:#ff}*while* (*true*) {{color}

     ...

       *try* (CloseableHttpResponse response = execute(post, context)) {

            *final* *int* statusCode = response.getStatusLine().getStatusCode();

            *if* (HttpURLConnection.*_HTTP_OK_* == statusCode

            ...

      {color:#ff}      {color}*else* *if* 
({color:#d04437}HttpURLConnection.*_HTTP_UNAVAILABLE_* == statusCode{color}) 

               *_LOG_*.debug("Failed to connect to server (HTTP/503), 
retrying");

              {color:#ff}*continue*;{color}

           }

       } *catch* (NoHttpResponseException e)

{           // This can happen when sitting behind a load balancer and a 
backend server dies            *_LOG_*.debug("The server failed to issue an 
HTTP response, retrying");            *continue*;       }

*catch* (RuntimeException e)

{           *throw* e;       }

*catch* (Exception e)

{           *_LOG_*.debug("Failed to execute HTTP request", e);           
*throw* *new* RuntimeException(e);       }

    ...

 

 

  was:
The implementation of AvaticaHttpClient
 * org.apache.calcite.avatica.remote.AvaticaHttpClientImpl

or 
 * org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl

 

"while (true) ... continue"

i have face that client run forever when HTTP code 503.

(i.e, Nginx proxy gateway failed return 503 code always)

 

 

---  red color  -

{color:#FF}*public* *byte*[] send(*byte*[] request){color} {

    {color:#FF}*while* (*true*) {{color}

     ...

       *try* (CloseableHttpResponse response = execute(post, context)) {

            *final* *int* statusCode = response.getStatusLine().getStatusCode();

            *if* (HttpURLConnection.*_HTTP_OK_* == statusCode

            ...

      {color:#FF}      {color}{color:#FF}} *else* *if* 
(HttpURLConnection.*_HTTP_UNAVAILABLE_* == statusCode) {{color}

               *_LOG_*.debug("Failed to connect to server (HTTP/503), 
retrying");

              {color:#FF}*continue*;{color}

           }

       } *catch* (NoHttpResponseException e) {

          // This can happen when sitting behind a load balancer and a backend 
server dies

           *_LOG_*.debug("The server failed to issue an HTTP response, 
retrying");

           *continue*;

      } *catch* (RuntimeException e) {

          *throw* e;

      } *catch* (Exception e) {

          *_LOG_*.debug("Failed to execute HTTP request", e);

          *throw* *new* RuntimeException(e);

      }

    ...

 

 


> Avatica Remote JDBC HttpClient may run Infinite loop
> 
>
> Key: CALCITE-3134
> URL: https://issues.apache.org/jira/browse/CALCITE-3134
> Project: Calcite
>  Issue Type: Improvement
>  Components: avatica
>Reporter: Leo Tu
>Priority: Major
>
> The implementation of AvaticaHttpClient
>  * org.apache.calcite.avatica.remote.AvaticaHttpClientImpl
> or 
>  * org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl
>  
> "while (true) ... 503 continue"
> i have face that client run forever when HTTP code 503.
> (i.e, Nginx proxy gateway failed return 503 code always)
>  
>  
> --  -red color-  
> {color:#ff}*public* *byte*[] send(*byte*[] request){color} {
>     {color:#ff}*while* (*true*) {{color}
>      ...
>        *try* (CloseableHttpResponse response = execute(post, context)) {
>             *final* *int* statusCode = 
> response.getStatusLine().getStatusCode();
>             *if* (HttpURLConnection.*_HTTP_OK_* == statusCode
>             ...
>       {color:#ff}      {color}*else* *if* 
> ({color:#d04437}HttpURLConnection.*_HTTP_UNAVAILABLE_* == statusCode{color}) 
>                *_LOG_*.debug("Failed to connect to server (HTTP/503), 
> retrying");
>               {color:#ff}*continue*;{color}
>            }
>        } *catch* (NoHttpResponseException e)
> {           // This can happen when sitting behind a load balancer and a 
> backend server dies            *_LOG_*.debug("The server failed to issue an 
> HTTP response, retrying");            *continue*;       }
> *catch* (RuntimeException e)
> {           *throw* e;       }
> *catch* (Exception e)
> {           *_LOG_*.debug("Failed to execute HTTP request", e);           

[jira] [Created] (CALCITE-3134) Avatica Remote JDBC HttpClient may run Infinite loop

2019-06-18 Thread Leo Tu (JIRA)
Leo Tu created CALCITE-3134:
---

 Summary: Avatica Remote JDBC HttpClient may run Infinite loop
 Key: CALCITE-3134
 URL: https://issues.apache.org/jira/browse/CALCITE-3134
 Project: Calcite
  Issue Type: Improvement
  Components: avatica
Reporter: Leo Tu


The implementation of AvaticaHttpClient
 * org.apache.calcite.avatica.remote.AvaticaHttpClientImpl

or 
 * org.apache.calcite.avatica.remote.AvaticaCommonsHttpClientImpl

 

"while (true) ... continue"

i have face that client run forever when HTTP code 503.

(i.e, Nginx proxy gateway failed return 503 code always)

 

 

---  red color  -

{color:#FF}*public* *byte*[] send(*byte*[] request){color} {

    {color:#FF}*while* (*true*) {{color}

     ...

       *try* (CloseableHttpResponse response = execute(post, context)) {

            *final* *int* statusCode = response.getStatusLine().getStatusCode();

            *if* (HttpURLConnection.*_HTTP_OK_* == statusCode

            ...

      {color:#FF}      {color}{color:#FF}} *else* *if* 
(HttpURLConnection.*_HTTP_UNAVAILABLE_* == statusCode) {{color}

               *_LOG_*.debug("Failed to connect to server (HTTP/503), 
retrying");

              {color:#FF}*continue*;{color}

           }

       } *catch* (NoHttpResponseException e) {

          // This can happen when sitting behind a load balancer and a backend 
server dies

           *_LOG_*.debug("The server failed to issue an HTTP response, 
retrying");

           *continue*;

      } *catch* (RuntimeException e) {

          *throw* e;

      } *catch* (Exception e) {

          *_LOG_*.debug("Failed to execute HTTP request", e);

          *throw* *new* RuntimeException(e);

      }

    ...

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (CALCITE-3114) Support websocket transport

2019-06-12 Thread Leo Tu (JIRA)


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

Leo Tu edited comment on CALCITE-3114 at 6/12/19 6:58 AM:
--

(1) HTTP handshake will consume time when large SQLs be executed

(2) Websocket and JDBC socket (can be mapping one to one) and work better when 
get and release transaction connection ASAP.


was (Author: leotu):
(1) HTTP handshake will consume time when large SQL be executed

(2) Websocket and JDBC socket (can be mapping one to one) and work better when 
get and release transaction connection ASAP.

> Support websocket transport
> ---
>
> Key: CALCITE-3114
> URL: https://issues.apache.org/jira/browse/CALCITE-3114
> Project: Calcite
>  Issue Type: Wish
>Reporter: Leo Tu
>Priority: Minor
>
> it would be greatly improve performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CALCITE-3114) Support websocket transport

2019-06-12 Thread Leo Tu (JIRA)


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

Leo Tu commented on CALCITE-3114:
-

(1) HTTP handshake will consume time when large SQL be executed

(2) Websocket and JDBC socket (can be mapping one to one) and work better when 
get and release transaction connection ASAP.

> Support websocket transport
> ---
>
> Key: CALCITE-3114
> URL: https://issues.apache.org/jira/browse/CALCITE-3114
> Project: Calcite
>  Issue Type: Wish
>Reporter: Leo Tu
>Priority: Minor
>
> it would be greatly improve performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (CALCITE-3114) Support websocket transport

2019-06-06 Thread Leo Tu (JIRA)


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

Leo Tu edited comment on CALCITE-3114 at 6/6/19 3:19 PM:
-

Currently, the client interacts with the server using the Http Request-Response 
mode.

If you can provide Client and Server interaction using websocket's frame to 
implement Request-Response
 that will be similar to the traditional JDBC Driver TCP/IP.

 

(1) Websocket client <-> (2)  

Websocket server <-> (3) Database Server

 

Transportation between:

(1) & (2) Websocket  Protocol (Connection/Statement/ResultSet Serializable)

(2) & (3) TCP/IP vender's  JDBC driver (Connection/Statement/ResultSet)

 

 

 

 


was (Author: leotu):
Currently, the client interacts with the server using the Http Request-Response 
mode.

If you can provide Client and Server interaction using websocket's frame to 
implement Request-Response
 that will be similar to the traditional JDBC Driver TCP/IP.

 

(1) Websocket client <-> (2)  

Websocket server <-> (3) Database Server

 

Transportation between:

(1) & (2) Websocket  Protocol (Connection/Statement/ResultSet Serializable)

(2) & (3) TPC/IP (Connection/Statement/ResultSet)

 

 

 

 

> Support websocket transport
> ---
>
> Key: CALCITE-3114
> URL: https://issues.apache.org/jira/browse/CALCITE-3114
> Project: Calcite
>  Issue Type: Wish
>Reporter: Leo Tu
>Priority: Minor
>
> it would be greatly improve performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (CALCITE-3114) Support websocket transport

2019-06-06 Thread Leo Tu (JIRA)


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

Leo Tu edited comment on CALCITE-3114 at 6/6/19 3:17 PM:
-

Currently, the client interacts with the server using the Http Request-Response 
mode.

If you can provide Client and Server interaction using websocket's frame to 
implement Request-Response
 that will be similar to the traditional JDBC Driver TCP/IP.

 

(1) Websocket client <-> (2)  

Websocket server <-> (3) Database Server

 

Transportation between:

(1) & (2) Websocket  Protocol (Connection/Statement/ResultSet Serializable)

(2) & (3) TPC/IP (Connection/Statement/ResultSet)

 

 

 

 


was (Author: leotu):
Currently, the client interacts with the server using the Http Request-Response 
mode.

If you can provide Client and Server interaction using websocket's frame to 
implement Request-Response
that will be similar to the traditional JDBC Driver TCP/IP.

 

                       
(1) 

 

Websocket client <> (2)  

Websocket server <> (3) Database Server

 

(1) & (2) is Websocket Protocal (Connection/Statement/ResultSet)

(2) & (3) TPC/IP (Connection/Statement/ResultSet)

 

 

 

 

> Support websocket transport
> ---
>
> Key: CALCITE-3114
> URL: https://issues.apache.org/jira/browse/CALCITE-3114
> Project: Calcite
>  Issue Type: Wish
>Reporter: Leo Tu
>Priority: Minor
>
> it would be greatly improve performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CALCITE-3114) Support websocket transport

2019-06-06 Thread Leo Tu (JIRA)
Leo Tu created CALCITE-3114:
---

 Summary: Support websocket transport
 Key: CALCITE-3114
 URL: https://issues.apache.org/jira/browse/CALCITE-3114
 Project: Calcite
  Issue Type: Wish
Reporter: Leo Tu


it would be greatly improve performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)