deniskuzZ commented on code in PR #3489: URL: https://github.com/apache/hive/pull/3489#discussion_r949873974
########## ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/StatsUpdater.java: ########## @@ -0,0 +1,84 @@ +/* + * 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; + +import org.apache.hadoop.hive.common.ValidTxnList; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.Warehouse; +import org.apache.hadoop.hive.metastore.txn.CompactionInfo; +import org.apache.hadoop.hive.ql.DriverUtils; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.ql.stats.StatsUtils; +import org.apache.tez.dag.api.TezConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +public final class StatsUpdater { + private static final Logger LOG = LoggerFactory.getLogger(StatsUpdater.class); + /** + * This doesn't throw any exceptions because we don't want the Compaction to appear as failed + * if stats gathering fails since this prevents Cleaner from doing it's job and if there are + * multiple failures, auto initiated compactions will stop which leads to problems that are + * much worse than stale stats. + * + * todo: longer term we should write something COMPACTION_QUEUE.CQ_META_INFO. This is a binary + * field so need to figure out the msg format and how to surface it in SHOW COMPACTIONS, etc + * + * @param ci Information about the compaction being run + * @param conf The hive configuration object + * @param userName The user to run the statistic collection with + * @param compactionQueueName The name of the compaction queue + */ + void gatherStats(CompactionInfo ci, HiveConf conf, String userName, String compactionQueueName) { Review Comment: should this be marked as public? that's the only method this service expose ########## ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/StatsUpdater.java: ########## @@ -0,0 +1,84 @@ +/* + * 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; + +import org.apache.hadoop.hive.common.ValidTxnList; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.Warehouse; +import org.apache.hadoop.hive.metastore.txn.CompactionInfo; +import org.apache.hadoop.hive.ql.DriverUtils; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.ql.stats.StatsUtils; +import org.apache.tez.dag.api.TezConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +public final class StatsUpdater { + private static final Logger LOG = LoggerFactory.getLogger(StatsUpdater.class); + /** + * This doesn't throw any exceptions because we don't want the Compaction to appear as failed + * if stats gathering fails since this prevents Cleaner from doing it's job and if there are + * multiple failures, auto initiated compactions will stop which leads to problems that are + * much worse than stale stats. + * + * todo: longer term we should write something COMPACTION_QUEUE.CQ_META_INFO. This is a binary + * field so need to figure out the msg format and how to surface it in SHOW COMPACTIONS, etc + * + * @param ci Information about the compaction being run + * @param conf The hive configuration object + * @param userName The user to run the statistic collection with + * @param compactionQueueName The name of the compaction queue + */ + void gatherStats(CompactionInfo ci, HiveConf conf, String userName, String compactionQueueName) { Review Comment: should this be marked as public? that's the only method this service exposes -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
