[ https://issues.apache.org/jira/browse/HIVE-25842?focusedWorklogId=712197&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-712197 ]
ASF GitHub Bot logged work on HIVE-25842: ----------------------------------------- Author: ASF GitHub Bot Created on: 20/Jan/22 16:59 Start Date: 20/Jan/22 16:59 Worklog Time Spent: 10m Work Description: lcspinter commented on a change in pull request #2916: URL: https://github.com/apache/hive/pull/2916#discussion_r788965590 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/metrics/DeltaFilesMetricReporter.java ########## @@ -34,99 +26,60 @@ 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.metastore.IMetaStoreClient; +import org.apache.hadoop.hive.metastore.api.CompactionMetricsDataStruct; +import org.apache.hadoop.hive.metastore.api.CompactionMetricsMetricType; +import org.apache.hadoop.hive.metastore.api.CompactionType; +import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.conf.MetastoreConf; -import org.apache.hadoop.hive.ql.exec.SerializationUtilities; -import org.apache.hadoop.hive.ql.hooks.ReadEntity; +import org.apache.hadoop.hive.metastore.txn.CompactionMetricsData; +import org.apache.hadoop.hive.metastore.txn.TxnStore; 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.CounterGroup; -import org.apache.tez.common.counters.TezCounter; -import org.apache.tez.common.counters.TezCounters; +import org.apache.thrift.TException; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.management.MBeanServer; import javax.management.ObjectName; import java.io.IOException; -import java.io.Serializable; import java.lang.management.ManagementFactory; -import java.util.Arrays; import java.util.ArrayList; -import java.util.Comparator; -import java.util.Date; -import java.util.EnumMap; -import java.util.HashMap; import java.util.List; -import java.util.PriorityQueue; -import java.util.Queue; - -import java.util.Set; +import java.util.Map; 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.Collectors; 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; -import static org.apache.hadoop.hive.ql.txn.compactor.metrics.DeltaFilesMetricReporter.DeltaFilesMetricType.NUM_DELTAS; -import static org.apache.hadoop.hive.ql.txn.compactor.metrics.DeltaFilesMetricReporter.DeltaFilesMetricType.NUM_OBSOLETE_DELTAS; -import static org.apache.hadoop.hive.ql.txn.compactor.metrics.DeltaFilesMetricReporter.DeltaFilesMetricType.NUM_SMALL_DELTAS; - /** * Collects and publishes ACID compaction related metrics. - * Everything should be behind 2 feature flags: {@link HiveConf.ConfVars#HIVE_SERVER2_METRICS_ENABLED} and + * Everything should be behind 2 feature flags: {@link MetastoreConf.ConfVars#METRICS_ENABLED} and * {@link MetastoreConf.ConfVars#METASTORE_ACIDMETRICS_EXT_ON}. - * First we store the information in the jobConf, then in Tez Counters, then in a cache stored here, then in a custom - * MBean. + * First we store the information in the HMS backend DB COMPACTION_METRICS_CACHE table, then in a custom MBean. Review comment: Done -- 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 712197) Time Spent: 6h (was: 5h 50m) > Reimplement delta file metric collection > ---------------------------------------- > > Key: HIVE-25842 > URL: https://issues.apache.org/jira/browse/HIVE-25842 > Project: Hive > Issue Type: Improvement > Reporter: László Pintér > Assignee: László Pintér > Priority: Major > Labels: pull-request-available > Time Spent: 6h > Remaining Estimate: 0h > > FUNCTIONALITY: Metrics are collected only when a Tez query runs a table > (select * and select count( * ) don't update the metrics) > Metrics aren't updated after compaction or cleaning after compaction, so > users will probably see "issues" with compaction (like many active or > obsolete or small deltas) that don't exist. > RISK: Metrics are collected during queries – we tried to put a try-catch > around each method in DeltaFilesMetricsReporter but of course this isn't > foolproof. This is a HUGE performance and functionality liability. Tests > caught some issues, but our tests aren't perfect. -- This message was sent by Atlassian Jira (v8.20.1#820001)