[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-07 Thread Rushabh Shah (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17824513#comment-17824513
 ] 

Rushabh Shah commented on PHOENIX-7243:
---

Thank you [~palashc] for the PR. 

> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
> Fix For: 5.3.0
>
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17824511#comment-17824511
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on PR #1839:
URL: https://github.com/apache/phoenix/pull/1839#issuecomment-1984248090

   Forgot to approve the PR. Belated +1.




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
> Fix For: 5.3.0
>
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17824510#comment-17824510
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 merged PR #1839:
URL: https://github.com/apache/phoenix/pull/1839




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-07 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17824500#comment-17824500
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on PR #1839:
URL: https://github.com/apache/phoenix/pull/1839#issuecomment-1984168480

   Change the title of the PR and commit to "PHOENIX-7243 : Add connectionType 
property to ConnectionInfo"
   There is 1 checkstyle warning that needs to be addressed.




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823727#comment-17823727
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#issuecomment-1979314957

   Thank you @stoty for your comment.
   Mostly this is a problem on the test side where PhoenixTestDriver is caching 
the server and non server connections.
   Looking at the code, MDEI always creates server connections but there is 
nothing enforcing in the code so there is a possibility that someone might 
create non server connection also.
   




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823518#comment-17823518
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

stoty commented on PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#issuecomment-1978334436

   I am not against this change, I just want to understand the problem better.
   
   Is there any reason ever not to use a server connection (or at least use the 
server connection methods to create it) on the server side ?
   Maybe it would be better to make sure that CQSI always uses server 
connections on the server side ?)
   Would that work ?




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823385#comment-17823385
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc commented on code in PR #1839:
URL: https://github.com/apache/phoenix/pull/1839#discussion_r1511993390


##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java:
##
@@ -36,6 +36,7 @@
 import org.apache.phoenix.query.HBaseFactoryProvider;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.QueryUtil;

Review Comment:
   Needed here - 
https://github.com/apache/phoenix/pull/1839/files#diff-1bb66a6bc989c1d63acbf10ef6f3f05dd9d86b6ec065f437d0b9332666b1f688R391





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823352#comment-17823352
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on code in PR #1839:
URL: https://github.com/apache/phoenix/pull/1839#discussion_r1508286177


##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java:
##
@@ -45,8 +45,8 @@ public String getBoostrapServers() {
 }
 
 protected AbstractRPCConnectionInfo(boolean isConnectionless, String 
principal, String keytab,
-User user, String haGroup) {
-super(isConnectionless, principal, keytab, user, haGroup);
+User user, String haGroup, Boolean isServerConnection) {

Review Comment:
   can we change `Boolean` --> `boolean` ?





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17823351#comment-17823351
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on code in PR #1839:
URL: https://github.com/apache/phoenix/pull/1839#discussion_r1508286177


##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/AbstractRPCConnectionInfo.java:
##
@@ -45,8 +45,8 @@ public String getBoostrapServers() {
 }
 
 protected AbstractRPCConnectionInfo(boolean isConnectionless, String 
principal, String keytab,
-User user, String haGroup) {
-super(isConnectionless, principal, keytab, user, haGroup);
+User user, String haGroup, Boolean isServerConnection) {

Review Comment:
   can we change `Boolean` --> `boolean` ?



##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java:
##
@@ -36,6 +36,7 @@
 import org.apache.phoenix.query.HBaseFactoryProvider;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.QueryUtil;

Review Comment:
   Is this needed?





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17822707#comment-17822707
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc commented on PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#issuecomment-1973876443

   @stoty This came up in 
[PHOENIX-6883](https://issues.apache.org/jira/browse/PHOENIX-6883) where we 
want to invalidate the metadata cache on a region server and only a server 
connection should be allowed to do so. Since we enforced that condition, some 
tests which tried to perform invalidation on a non-server connection failed. 




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-03-01 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17822582#comment-17822582
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

stoty commented on PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#issuecomment-1973246638

   Server connections are always opened on the server, and they are only 
special in that they are cached and cannot be closed.
   
   How would creating a new server connection help if we already have a similar 
non-server connection ?




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821908#comment-17821908
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc commented on PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#issuecomment-1970198673

   Opened https://github.com/apache/phoenix/pull/1839 for master branch 
@shahrs87 




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821909#comment-17821909
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc closed pull request #1838: PHOENIX-7243 : Add isServerConnection 
property to ConnectionInfo
URL: https://github.com/apache/phoenix/pull/1838




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821907#comment-17821907
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc opened a new pull request, #1839:
URL: https://github.com/apache/phoenix/pull/1839

   (no comment)




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821885#comment-17821885
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc commented on code in PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#discussion_r1506758361


##
phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java:
##
@@ -92,7 +93,8 @@ public synchronized Connection connect(String url, Properties 
info) throws SQLEx
 public synchronized ConnectionQueryServices 
getConnectionQueryServices(String url, Properties infoIn) throws SQLException {
 checkClosed();
 final Properties info = PropertiesUtil.deepCopy(infoIn);
-ConnectionInfo connInfo = ConnectionInfo.create(url, null, info);
+boolean isServerConnection = 
Boolean.valueOf(info.getProperty(QueryUtil.IS_SERVER_CONNECTION));
+ConnectionInfo connInfo = ConnectionInfo.create(url, null, info, 
isServerConnection);

Review Comment:
   Pushed the refactor, no changes in Drivers needed. 



##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java:
##
@@ -114,6 +115,15 @@ public static ConnectionInfo create(String url, 
ReadOnlyProps props, Properties
 return create(url, conf, props, info);
 }
 
+public static ConnectionInfo create(String url, ReadOnlyProps props,
+Properties info, boolean isServerConnection)
+throws SQLException {
+Configuration conf = 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
+ConnectionInfo connInfo = create(url, conf, props, info);
+connInfo.isServerConnection = isServerConnection;

Review Comment:
   Done. 





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821878#comment-17821878
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on code in PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#discussion_r1506718473


##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java:
##
@@ -114,6 +115,15 @@ public static ConnectionInfo create(String url, 
ReadOnlyProps props, Properties
 return create(url, conf, props, info);
 }
 
+public static ConnectionInfo create(String url, ReadOnlyProps props,
+Properties info, boolean isServerConnection)
+throws SQLException {
+Configuration conf = 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
+ConnectionInfo connInfo = create(url, conf, props, info);
+connInfo.isServerConnection = isServerConnection;

Review Comment:
   All the other variables are being set via Builder. Lets not break that 
pattern for `isServerConnection`





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821877#comment-17821877
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on code in PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#discussion_r1506717514


##
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java:
##
@@ -114,6 +115,15 @@ public static ConnectionInfo create(String url, 
ReadOnlyProps props, Properties
 return create(url, conf, props, info);
 }
 
+public static ConnectionInfo create(String url, ReadOnlyProps props,
+Properties info, boolean isServerConnection)
+throws SQLException {
+Configuration conf = 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
+ConnectionInfo connInfo = create(url, conf, props, info);
+connInfo.isServerConnection = isServerConnection;

Review Comment:
   I think we should initialize `isServerConnection` the same way we are 
initializing principal, keytab, user and haGroup variables.





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821876#comment-17821876
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

shahrs87 commented on code in PR #1838:
URL: https://github.com/apache/phoenix/pull/1838#discussion_r1506709112


##
phoenix-core/src/test/java/org/apache/phoenix/jdbc/PhoenixTestDriver.java:
##
@@ -92,7 +93,8 @@ public synchronized Connection connect(String url, Properties 
info) throws SQLEx
 public synchronized ConnectionQueryServices 
getConnectionQueryServices(String url, Properties infoIn) throws SQLException {
 checkClosed();
 final Properties info = PropertiesUtil.deepCopy(infoIn);
-ConnectionInfo connInfo = ConnectionInfo.create(url, null, info);
+boolean isServerConnection = 
Boolean.valueOf(info.getProperty(QueryUtil.IS_SERVER_CONNECTION));
+ConnectionInfo connInfo = ConnectionInfo.create(url, null, info, 
isServerConnection);

Review Comment:
   Why do we want to pass as a separate argument for `isServerConnection`?  It 
is present in `info` object anyways.





> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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


[jira] [Commented] (PHOENIX-7243) Add isServerConnection property to ConnectionInfo class.

2024-02-28 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-7243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17821866#comment-17821866
 ] 

ASF GitHub Bot commented on PHOENIX-7243:
-

palashc opened a new pull request, #1838:
URL: https://github.com/apache/phoenix/pull/1838

   (no comment)




> Add isServerConnection property to ConnectionInfo class.
> 
>
> Key: PHOENIX-7243
> URL: https://issues.apache.org/jira/browse/PHOENIX-7243
> Project: Phoenix
>  Issue Type: Sub-task
>Reporter: Rushabh Shah
>Assignee: Palash Chauhan
>Priority: Major
>
> In PhoenixDriver, we have a cache of ConnectionQueryServices which is keyed 
> by ConnectionInfo object. Refer 
> [here|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java#L258-L270]
>  for more details.
> Lets say if we want to create a server  connection (with property 
> IS_SERVER_CONNECTION set to true) and we already have a _non server_ 
> connection present in the cache (with the same user, principal, keytab, 
> haGroup), it will return the non server connection.
> We need to add isServerConnection property to 
> [ConnectionInfo|https://github.com/apache/phoenix/blob/master/phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/ConnectionInfo.java#L317-L334]
>  class to differentiate between server and non server connection.



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