[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-05-18 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=598622=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-598622
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 18/May/21 15:02
Start Date: 18/May/21 15:02
Worklog Time Spent: 10m 
  Work Description: deniskuzZ merged pull request #2148:
URL: https://github.com/apache/hive/pull/2148


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 598622)
Time Spent: 2h 50m  (was: 2h 40m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587744=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587744
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 23/Apr/21 09:32
Start Date: 23/Apr/21 09:32
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r619080326



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3013,14 +3013,15 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 new TimeValidator(TimeUnit.SECONDS),
 "Reporting period for ACID metrics in seconds."),
 
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
-"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+"he minimum number of active delta files a table/partition must have 
in order to be included in the ACID metrics report."),

Review comment:
   fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 587744)
Time Spent: 2h 40m  (was: 2.5h)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-23 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587743=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587743
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 23/Apr/21 09:32
Start Date: 23/Apr/21 09:32
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r619080240



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -45,32 +45,46 @@
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.util.Comparator;
+import java.util.*;

Review comment:
   fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 587743)
Time Spent: 2.5h  (was: 2h 20m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587318=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587318
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 22/Apr/21 15:35
Start Date: 22/Apr/21 15:35
Worklog Time Spent: 10m 
  Work Description: klcopp commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r618509889



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -45,32 +45,46 @@
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.util.Comparator;
+import java.util.*;

Review comment:
   Nit: I think it's best to import classes one-by-one

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3013,14 +3013,15 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 new TimeValidator(TimeUnit.SECONDS),
 "Reporting period for ACID metrics in seconds."),
 
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
-"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+"he minimum number of active delta files a table/partition must have 
in order to be included in the ACID metrics report."),

Review comment:
   Nit: spelling

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3013,14 +3013,15 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 new TimeValidator(TimeUnit.SECONDS),
 "Reporting period for ACID metrics in seconds."),
 
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
-"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+"he minimum number of active delta files a table/partition must have 
in order to be included in the ACID metrics report."),
 
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,
-"The minimum number of obsolete delta files a table/partition must be 
included in the ACID metrics report."),
+"he minimum number of obsolete delta files a table/partition must have 
in order to be included in the ACID metrics report."),

Review comment:
   Nit: spelling




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 587318)
Time Spent: 2h 20m  (was: 2h 10m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587308=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587308
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 22/Apr/21 15:29
Start Date: 22/Apr/21 15:29
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r618507217



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,
+"The minimum number of obsolete delta files a table/partition must be 
included in the ACID metrics report."),

Review comment:
   fixed

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),

Review comment:
   fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 587308)
Time Spent: 2h 10m  (was: 2h)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587306=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587306
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 22/Apr/21 15:28
Start Date: 22/Apr/21 15:28
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r618506403



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -0,0 +1,296 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.txn.compactor.metrics;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Splitter;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+
+import com.google.common.cache.RemovalNotification;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.common.metrics.common.Metrics;
+import org.apache.hadoop.hive.common.metrics.common.MetricsFactory;
+import org.apache.hadoop.hive.common.metrics.common.MetricsVariable;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.io.AcidDirectory;
+import org.apache.hadoop.hive.ql.io.AcidUtils;
+
+import org.apache.hadoop.hive.shims.HadoopShims;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hive.common.util.Ref;
+import org.apache.tez.common.counters.TezCounters;
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Comparator;
+
+import java.util.Map;
+import java.util.Queue;
+import java.util.concurrent.Executors;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.PriorityBlockingQueue;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import static 
org.apache.hadoop.hive.metastore.metrics.MetricsConstants.COMPACTION_NUM_DELTAS;
+import static 
org.apache.hadoop.hive.metastore.metrics.MetricsConstants.COMPACTION_NUM_OBSOLETE_DELTAS;
+import static 
org.apache.hadoop.hive.metastore.metrics.MetricsConstants.COMPACTION_NUM_SMALL_DELTAS;
+
+/**
+ * Collects and publishes ACID compaction related metrics.
+ */
+public class DeltaFilesMetricReporter {
+
+  private static final Logger LOG = LoggerFactory.getLogger(AcidUtils.class);
+
+  public static final String NUM_OBSOLETE_DELTAS = 
"HIVE_ACID_NUM_OBSOLETE_DELTAS";
+  public static final String NUM_DELTAS = "HIVE_ACID_NUM_DELTAS";
+  public static final String NUM_SMALL_DELTAS = "HIVE_ACID_NUM_SMALL_DELTAS";
+
+  private int deltasThreshold;
+  private int obsoleteDeltasThreshold;
+
+  private int maxCacheSize;
+
+  private Cache deltaCache, smallDeltaCache;
+  private Cache obsoleteDeltaCache;
+
+  private BlockingQueue> deltaTopN, smallDeltaTopN;
+  private BlockingQueue> obsoleteDeltaTopN;
+
+  private ScheduledExecutorService executorService;
+
+  private static class InstanceHolder {
+public static DeltaFilesMetricReporter instance = new 
DeltaFilesMetricReporter();
+  }
+
+  private DeltaFilesMetricReporter() {
+  }
+
+  public static DeltaFilesMetricReporter getInstance() {
+return InstanceHolder.instance;
+  }
+
+  public static synchronized void init(HiveConf conf){
+getInstance().configure(conf);
+  }
+
+  public void submit(TezCounters counters) {
+updateMetrics(NUM_OBSOLETE_DELTAS,
+obsoleteDeltaCache, obsoleteDeltaTopN, obsoleteDeltasThreshold, 
counters);
+updateMetrics(NUM_DELTAS,
+deltaCache, deltaTopN, deltasThreshold, counters);
+updateMetrics(NUM_SMALL_DELTAS,
+smallDeltaCache, smallDeltaTopN, deltasThreshold, counters);
+  }
+
+  public static Pair 

[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587307=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587307
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 22/Apr/21 15:29
Start Date: 22/Apr/21 15:29
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r618507026



##
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metrics/MetricsConstants.java
##
@@ -33,6 +33,10 @@
   public static final String OLDEST_ABORTED_TXN_ID = "oldest_aborted_txn_id";
   public static final String OLDEST_ABORTED_TXN_AGE = 
"oldest_aborted_txn_age_in_sec";
 
+  public static final String COMPACTION_NUM_OBSOLETE_DELTAS = 
COMPACTION_STATUS_PREFIX + "obsolete_deltas";
+  public static final String COMPACTION_NUM_DELTAS = COMPACTION_STATUS_PREFIX 
+ "deltas";

Review comment:
   fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 587307)
Time Spent: 2h  (was: 1h 50m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=587284=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-587284
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 22/Apr/21 15:10
Start Date: 22/Apr/21 15:10
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r618491204



##
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java
##
@@ -254,6 +255,10 @@ public int execute() {
 try {
   Set statusGetOpts = 
EnumSet.of(StatusGetOpts.GET_COUNTERS);
   TezCounters dagCounters = 
dagClient.getDAGStatus(statusGetOpts).getDAGCounters();
+
+  if (HiveConf.getBoolVar(conf, 
HiveConf.ConfVars.HIVE_SERVER2_METRICS_ENABLED)) {

Review comment:
   i think, we have separate JIRA for that




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 587284)
Time Spent: 1h 40m  (was: 1.5h)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=586510=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-586510
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 21/Apr/21 12:00
Start Date: 21/Apr/21 12:00
Worklog Time Spent: 10m 
  Work Description: klcopp commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r617468227



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),

Review comment:
   This is a bit more verbose and maybe more clear: The minimum number of 
active delta files a table/partition must have in order to be included in the 
ACID metrics report.
   (As in, a table/partition must have x number of files in order to be 
included  :) )




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 586510)
Time Spent: 1.5h  (was: 1h 20m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=586383=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-586383
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 21/Apr/21 07:42
Start Date: 21/Apr/21 07:42
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r617277648



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,
+"The minimum number of obsolete delta files a table/partition must be 
included in the ACID metrics report."),

Review comment:
   same as above :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 586383)
Time Spent: 1h 20m  (was: 1h 10m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=586382=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-586382
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 21/Apr/21 07:41
Start Date: 21/Apr/21 07:41
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r617277318



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),

Review comment:
   :) I am not a native speaker but I ran this through Google translate and 
Grammarly and both have corrected "must have to be" -> "should be" / "must have 
been"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 586382)
Time Spent: 1h 10m  (was: 1h)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-21 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=586378=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-586378
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 21/Apr/21 07:34
Start Date: 21/Apr/21 07:34
Worklog Time Spent: 10m 
  Work Description: deniskuzZ commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r617272518



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,
+"The minimum number of obsolete delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_DELTA_CHECK_THRESHOLD("hive.txn.acid.metrics.delta.check.threshold",
 "300s",
+new TimeValidator(TimeUnit.SECONDS),
+"Deltas not older than this value will not be included in the ACID 
metrics report."),

Review comment:
   no, it's the other way around. We don't want to include fresh deltas.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 586378)
Time Spent: 1h  (was: 50m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-20 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=585991=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-585991
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 20/Apr/21 16:36
Start Date: 20/Apr/21 16:36
Worklog Time Spent: 10m 
  Work Description: klcopp commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r616843875



##
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezTask.java
##
@@ -254,6 +255,10 @@ public int execute() {
 try {
   Set statusGetOpts = 
EnumSet.of(StatusGetOpts.GET_COUNTERS);
   TezCounters dagCounters = 
dagClient.getDAGStatus(statusGetOpts).getDAGCounters();
+
+  if (HiveConf.getBoolVar(conf, 
HiveConf.ConfVars.HIVE_SERVER2_METRICS_ENABLED)) {

Review comment:
   Maybe a feature flag for these specific metrics would be a good idea. 
What do you think?

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,
+"The minimum number of obsolete delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_DELTA_CHECK_THRESHOLD("hive.txn.acid.metrics.delta.check.threshold",
 "300s",
+new TimeValidator(TimeUnit.SECONDS),
+"Deltas not older than this value will not be included in the ACID 
metrics report."),

Review comment:
   Should be: Deltas older than this value will not be included in the ACID 
metrics report

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,26 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+// Configs having to do with DeltaFilesMetricReporter, which collects 
lists of most recently active tables
+// with the most number of active/obsolete deltas.
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"The minimum number of active delta files a table/partition must be 
included in the ACID metrics report."),
+
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,
+"The minimum number of obsolete delta files a table/partition must be 
included in the ACID metrics report."),

Review comment:
   ...a table/partition must be ...
   should be: ...a table/partition must have to be ...

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -0,0 +1,296 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed 

[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=581828=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-581828
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 13/Apr/21 14:54
Start Date: 13/Apr/21 14:54
Worklog Time Spent: 10m 
  Work Description: klcopp commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r612517973



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,22 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,
+"Threshold for the number of delta files to include in the ACID 
metrics report."),
+
HIVE_TXN_ACID_METRICS_OBSOLETE_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.obsolete.delta.num.threshold",
 100,

Review comment:
   Similar to above

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,22 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+
HIVE_TXN_ACID_METRICS_CACHE_DURATION("hive.txn.acid.metrics.cache.duration", 
"7200s",
+new TimeValidator(TimeUnit.SECONDS),
+"Maximum lifetime in seconds for an entry in the ACID metrics cache."),
+
HIVE_TXN_ACID_METRICS_REPORTING_INTERVAL("hive.txn.acid.metrics.reporting.interval",
 "30s",
+new TimeValidator(TimeUnit.SECONDS),
+"Reporting period for ACID metrics in seconds."),
+
HIVE_TXN_ACID_METRICS_DELTA_NUM_THRESHOLD("hive.txn.acid.metrics.delta.num.threshold",
 100,

Review comment:
   Isn't this: the minimum number of active delta files a table/partition 
must have to be included in the report

##
File path: 
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/TestCompactionMetrics.java
##
@@ -43,17 +44,18 @@
 import org.apache.hadoop.hive.metastore.metrics.Metrics;
 import org.apache.hadoop.hive.metastore.metrics.MetricsConstants;
 import org.apache.hadoop.hive.metastore.txn.TxnStore;
+import 
org.apache.hadoop.hive.ql.txn.compactor.metrics.DeltaFilesMetricReporter;
+import org.apache.tez.common.counters.TezCounters;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;

Review comment:
   I think it's not recommended to import all classes in the package

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,22 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 

Review comment:
   Here I would add a comment like:
   Configs having to do with DeltaFilesMetricReporter, which collects lists of 
most recently active tables with the most number of active/obsolete deltas.

##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,22 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,
+"Size of the ACID metrics cache. Only topN metrics would remain in the 
cache if exceeded."),
+

[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-13 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=581657=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-581657
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 13/Apr/21 09:43
Start Date: 13/Apr/21 09:43
Worklog Time Spent: 10m 
  Work Description: klcopp commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r612295409



##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.txn.compactor.metrics;
+
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+
+import com.google.common.cache.RemovalNotification;
+import com.google.common.collect.Maps;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.common.metrics.common.Metrics;
+import org.apache.hadoop.hive.common.metrics.common.MetricsFactory;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.io.AcidDirectory;
+import org.apache.hadoop.hive.ql.io.AcidUtils;
+
+import org.apache.tez.common.counters.TezCounter;
+import org.apache.tez.common.counters.TezCounters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Comparator;
+
+import java.util.Queue;
+import java.util.TreeMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.PriorityBlockingQueue;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Collects and publishes ACID compaction related metrics.
+ */
+public class DeltaFilesMetricReporter {
+
+  private static final Logger LOG = LoggerFactory.getLogger(AcidUtils.class);
+
+  public static final String NUM_OBSOLETE_DELTAS = 
"HIVE_ACID_NUM_OBSOLETE_DELTAS";

Review comment:
   I think also part of the plan was a 3rd metric : Number of deltas where 
the size is less than x % of the base (small deltas)?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 581657)
Time Spent: 0.5h  (was: 20m)

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-08 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=579352=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-579352
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 08/Apr/21 16:37
Start Date: 08/Apr/21 16:37
Worklog Time Spent: 10m 
  Work Description: klcopp commented on a change in pull request #2148:
URL: https://github.com/apache/hive/pull/2148#discussion_r609883207



##
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##
@@ -3002,6 +3002,22 @@ private static void 
populateLlapDaemonVarsSet(Set llapDaemonVarsSetLocal
 HIVE_TXN_READONLY_ENABLED("hive.txn.readonly.enabled", false,
   "Enables read-only transaction classification and related 
optimizations"),
 
+
HIVE_TXN_ACID_METRICS_MAX_CACHE_SIZE("hive.txn.acid.metrics.max.cache.size", 
100,

Review comment:
   Could the descriptions be a bit longer and clearer? From users' 
perspective I don't think the meanings of the configs are obvious.

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.txn.compactor.metrics;
+
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+
+import com.google.common.cache.RemovalNotification;
+import com.google.common.collect.Maps;
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.hadoop.fs.FileStatus;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.common.metrics.common.Metrics;
+import org.apache.hadoop.hive.common.metrics.common.MetricsFactory;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.io.AcidDirectory;
+import org.apache.hadoop.hive.ql.io.AcidUtils;
+
+import org.apache.tez.common.counters.TezCounter;
+import org.apache.tez.common.counters.TezCounters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Comparator;
+
+import java.util.Queue;
+import java.util.TreeMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.PriorityBlockingQueue;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Collects and publishes ACID compaction related metrics.
+ */
+public class DeltaFilesMetricReporter {
+
+  private static final Logger LOG = LoggerFactory.getLogger(AcidUtils.class);
+
+  public static final String NUM_OBSOLETE_DELTAS = 
"HIVE_ACID_NUM_OBSOLETE_DELTAS";
+  public static final String NUM_DELTAS = "HIVE_ACID_NUM__DELTAS";

Review comment:
   nit: 2 underscores

##
File path: 
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java
##
@@ -0,0 +1,211 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.txn.compactor.metrics;
+
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+
+import com.google.common.cache.RemovalNotification;
+import com.google.common.collect.Maps;
+import 

[jira] [Work logged] (HIVE-24974) Create new metrics about the number of delta files in the ACID table

2021-04-05 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-24974?focusedWorklogId=576815=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-576815
 ]

ASF GitHub Bot logged work on HIVE-24974:
-

Author: ASF GitHub Bot
Created on: 05/Apr/21 11:49
Start Date: 05/Apr/21 11:49
Worklog Time Spent: 10m 
  Work Description: deniskuzZ opened a new pull request #2148:
URL: https://github.com/apache/hive/pull/2148


   … ACID table
   
   
   
   ### What changes were proposed in this pull request?
   
   
   
   ### Why are the changes needed?
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   
   
   ### How was this patch tested?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 576815)
Remaining Estimate: 0h
Time Spent: 10m

> Create new metrics about the number of delta files in the ACID table
> 
>
> Key: HIVE-24974
> URL: https://issues.apache.org/jira/browse/HIVE-24974
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Denys Kuzmenko
>Assignee: Denys Kuzmenko
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> 2 metrics should be collected by each table/partition that exceeds some limit.
>  * Number of used deltas
>  * Number of obsolete deltas
> Both of them should be collected in AcidUtils.getAcidstate call, and only be 
> published if they reached a configurable threshold (to not pollute metrics) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)