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

Andrew Purtell commented on PHOENIX-3607:
-----------------------------------------

[~gjacoby] [~jamestaylor] An easy way to address that is the following, perhaps 
as an addendum to PHOENIX-3611. 
{code}
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java 
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java
index b2acacf..67ac9c9 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java
@@ -149,8 +149,6 @@ public final class PhoenixDriver extends 
PhoenixEmbeddedDriver {
 
     private Cache<ConnectionInfo, ConnectionQueryServices> 
initializeConnectionCache() {
         Configuration config = 
HBaseFactoryProvider.getConfigurationFactory().getConfiguration();
-        int maxCacheSize = 
config.getInt(QueryServices.CLIENT_CONNECTION_CACHE_MAX_SIZE,
-            QueryServicesOptions.DEFAULT_CLIENT_CONNECTION_CACHE_MAX_SIZE);
         int maxCacheDuration = 
config.getInt(QueryServices.CLIENT_CONNECTION_CACHE_MAX_DURATION_MILLISECONDS,
             QueryServicesOptions.DEFAULT_CLIENT_CONNECTION_CACHE_MAX_DURATION);
         RemovalListener<ConnectionInfo, ConnectionQueryServices> 
cacheRemovalListener =
@@ -170,7 +168,6 @@ public final class PhoenixDriver extends 
PhoenixEmbeddedDriver {
                 }
             };
         return CacheBuilder.newBuilder()
-            .maximumSize(maxCacheSize)
             .expireAfterAccess(maxCacheDuration, TimeUnit.MILLISECONDS)
             .removalListener(cacheRemovalListener)
             .build();
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
index 233007f..2335c36 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
@@ -234,7 +234,6 @@ public interface QueryServices extends SQLCloseable {
     public static final String CLIENT_CACHE_ENCODING = 
"phoenix.table.client.cache.encoding";
     public static final String AUTO_UPGRADE_ENABLED = 
"phoenix.autoupgrade.enabled";
 
-    public static final String CLIENT_CONNECTION_CACHE_MAX_SIZE = 
"phoenix.client.connection.cache.max.size";
     public static final String 
CLIENT_CONNECTION_CACHE_MAX_DURATION_MILLISECONDS =
         "phoenix.client.connection.max.duration";
     /**
{code}
We keep the expiry by LRU by age but drop the effective limit on total 
connections, more in keeping with the scope of that issue as conveyed by its 
description. 

> Change hashCode calculation for caching ConnectionQueryServicesImpls
> --------------------------------------------------------------------
>
>                 Key: PHOENIX-3607
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3607
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.8.0, 4.9.0
>            Reporter: Geoffrey Jacoby
>            Assignee: Geoffrey Jacoby
>
> PhoenixDriver maintains a cache of ConnectionInfo -> 
> ConnectionQueryServicesImpl (each of which holds a single HConnection) : 
> The hash code of ConnectionInfo in part uses the hash code of its HBase User 
> object, which uses the *identity hash* of the Subject allocated at login. 
> There are concerns about the stability of this hashcode. When we log out and 
> log in after TGT refresh, will we have a new Subject?
> To be defensive, we should do a hash of the string returned by user.getName() 
> instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to