Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.3 e8d3ed00c -> a22c8de6a
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/a22c8de6 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a22c8de6 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a22c8de6 Branch: refs/heads/4.x-HBase-1.3 Commit: a22c8de6a0479745a2c861f1f5c553f219e9466c Parents: 4110f08 Author: James Taylor <jtay...@salesforce.com> Authored: Tue Feb 27 12:24:06 2018 -0800 Committer: James Taylor <jtay...@salesforce.com> Committed: Tue Feb 27 12:46:37 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/a22c8de6/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 6905fc3..8dadbb0 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 @@ -235,6 +235,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; @@ -381,6 +383,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/a22c8de6/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 8be3dcf..e7f7795 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 @@ -1165,9 +1165,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;