This is an automated email from the ASF dual-hosted git repository.
gsaihemanth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new d62379e4c2e HIVE-29017: Restore ability to prevent metastore metrics
startup queries (#5869)
d62379e4c2e is described below
commit d62379e4c2ed36bc4b0651e6117040a3df0e2606
Author: Chris Nauroth <[email protected]>
AuthorDate: Mon Jun 23 09:47:25 2025 -0700
HIVE-29017: Restore ability to prevent metastore metrics startup queries
(#5869)
---
.../main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java | 3 +++
.../src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git
a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
index f5c58cb7e9a..2d84c9028bc 100644
---
a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
+++
b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java
@@ -943,6 +943,9 @@ public enum ConfVars {
INIT_HOOKS("metastore.init.hooks", "hive.metastore.init.hooks", "",
"A comma separated list of hooks to be invoked at the beginning of
HMSHandler initialization. \n" +
"An init hook is specified as the name of Java class which extends
org.apache.riven.MetaStoreInitListener."),
+ INIT_METADATA_COUNT_ENABLED("metastore.initial.metadata.count.enabled",
+ "hive.metastore.initial.metadata.count.enabled", true,
+ "Enable a metadata count at metastore startup for metrics."),
INTEGER_JDO_PUSHDOWN("metastore.integral.jdo.pushdown",
"hive.metastore.integral.jdo.pushdown", false,
"Allow JDO query pushdown for integral partition columns in metastore.
Off by default. This\n" +
diff --git
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
index e0d418b661d..985f42e278c 100644
---
a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
+++
b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
@@ -10055,7 +10055,8 @@ public CacheFileMetadataResult cache_file_metadata(
@VisibleForTesting
void updateMetrics() throws MetaException {
- if (Metrics.getRegistry() != null) {
+ if (Metrics.getRegistry() != null &&
+ MetastoreConf.getBoolVar(conf, ConfVars.INIT_METADATA_COUNT_ENABLED)) {
LOG.info("Begin calculating metadata count metrics.");
Metrics.getOrCreateGauge(MetricsConstants.TOTAL_TABLES).set(getMS().getTableCount());
Metrics.getOrCreateGauge(MetricsConstants.TOTAL_PARTITIONS).set(getMS().getPartitionCount());