You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2018/02/27 20:59:59 UTC

[3/3] phoenix git commit: PHOENIX-4628 Allow min time between update stats to be configurable separately from stats cache TTL

PHOENIX-4628 Allow min time between update stats to be configurable separately from stats cache TTL


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

Branch: refs/heads/4.x-HBase-0.98
Commit: e56d92fe95ba4a4dec024b08578c42c45201541f
Parents: 86985b6
Author: James Taylor <jt...@salesforce.com>
Authored: Tue Feb 27 12:24:06 2018 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Tue Feb 27 12:58:40 2018 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/query/QueryServicesOptions.java | 3 +++
 .../src/main/java/org/apache/phoenix/schema/MetaDataClient.java  | 4 +---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/e56d92fe/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 5d39688..b30413c 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
@@ -223,6 +223,8 @@ public class QueryServicesOptions {
     public static final int DEFAULT_STATS_POOL_SIZE = 4;
     // Maximum size (in bytes) that cached table stats should take upm
     public static final long DEFAULT_STATS_MAX_CACHE_SIZE = 256 * 1024 * 1024;
+    // Allow stats collection to be initiated by client multiple times immediately
+    public static final int DEFAULT_MIN_STATS_UPDATE_FREQ_MS = 0;
 
     public static final boolean DEFAULT_USE_REVERSE_SCAN = true;
 
@@ -362,6 +364,7 @@ public class QueryServicesOptions {
             .setIfUnset(DATE_FORMAT_ATTRIB, DEFAULT_DATE_FORMAT)
             .setIfUnset(DATE_FORMAT_TIMEZONE_ATTRIB, DEFAULT_DATE_FORMAT_TIMEZONE)
             .setIfUnset(STATS_UPDATE_FREQ_MS_ATTRIB, DEFAULT_STATS_UPDATE_FREQ_MS)
+            .setIfUnset(MIN_STATS_UPDATE_FREQ_MS_ATTRIB, DEFAULT_MIN_STATS_UPDATE_FREQ_MS)
             .setIfUnset(CALL_QUEUE_ROUND_ROBIN_ATTRIB, DEFAULT_CALL_QUEUE_ROUND_ROBIN)
             .setIfUnset(MAX_MUTATION_SIZE_ATTRIB, DEFAULT_MAX_MUTATION_SIZE)
             .setIfUnset(ROW_KEY_ORDER_SALTED_TABLE_ATTRIB, DEFAULT_FORCE_ROW_KEY_ORDER)

http://git-wip-us.apache.org/repos/asf/phoenix/blob/e56d92fe/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
index 75b8eff..3b38ede 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
@@ -1159,9 +1159,7 @@ public class MetaDataClient {
     private long updateStatisticsInternal(PName physicalName, PTable logicalTable, Map<String, Object> statsProps, List<byte[]> cfs, boolean checkLastStatsUpdateTime) throws SQLException {
         ReadOnlyProps props = connection.getQueryServices().getProps();
         final long msMinBetweenUpdates = props
-                .getLong(QueryServices.MIN_STATS_UPDATE_FREQ_MS_ATTRIB,
-                        props.getLong(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB,
-                                QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS) / 2);
+                .getLong(QueryServices.MIN_STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_MIN_STATS_UPDATE_FREQ_MS);
         Long scn = connection.getSCN();
         // Always invalidate the cache
         long clientTimeStamp = connection.getSCN() == null ? HConstants.LATEST_TIMESTAMP : scn;