phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [3/3] phoenix git commit: PHOENIX-4628 Allow min time between update stats to be configurable separately from stats cache TTL
Date Tue, 27 Feb 2018 22:05:19 GMT
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/6dcc24fa
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6dcc24fa
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6dcc24fa

Branch: refs/heads/5.x-HBase-2.0
Commit: 6dcc24fa4b5d8970c283da8e2ff5f7d1c932c4ce
Parents: 0e42ecf
Author: James Taylor <jtaylor@salesforce.com>
Authored: Tue Feb 27 12:24:06 2018 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Tue Feb 27 14:05:03 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/6dcc24fa/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 f2cf92d..638c36e 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
@@ -233,6 +233,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;
 
@@ -376,6 +378,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/6dcc24fa/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 bd52070..7dfc2b5 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
@@ -1163,9 +1163,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;


Mime
View raw message