Amend PHOENIX-3611 ConnectionQueryService should expire LRU entries

Signed-off-by: Andrew Purtell <apurt...@apache.org>

Do not enforce a maximum size on the client connection cache.


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cd8f0535
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cd8f0535
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cd8f0535

Branch: refs/heads/encodecolumns2
Commit: cd8f0535b6e52635a375a72f800a36ab5a0e292b
Parents: d971192
Author: gjacoby <gjac...@salesforce.com>
Authored: Wed Jan 25 13:49:26 2017 -0800
Committer: Andrew Purtell <apurt...@apache.org>
Committed: Wed Jan 25 19:10:01 2017 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java      | 3 ---
 .../src/main/java/org/apache/phoenix/query/QueryServices.java     | 1 -
 .../main/java/org/apache/phoenix/query/QueryServicesOptions.java  | 1 -
 3 files changed, 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cd8f0535/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixDriver.java
----------------------------------------------------------------------
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 ba06ed9..f90e5ec 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();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cd8f0535/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServices.java
----------------------------------------------------------------------
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 e77e01f..dc949ea 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
@@ -233,7 +233,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";
     /**

http://git-wip-us.apache.org/repos/asf/phoenix/blob/cd8f0535/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index 13fb9ea..a15009a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -259,7 +259,6 @@ public class QueryServicesOptions {
     
     public static final String DEFAULT_CLIENT_CACHE_ENCODING = 
PTableRefFactory.Encoding.OBJECT.toString();
     public static final boolean DEFAULT_AUTO_UPGRADE_ENABLED = true;
-    public static final int DEFAULT_CLIENT_CONNECTION_CACHE_MAX_SIZE = 100;
     public static final int DEFAULT_CLIENT_CONNECTION_CACHE_MAX_DURATION = 
86400000;
 
     @SuppressWarnings("serial")

Reply via email to