tarak271 commented on code in PR #4970: URL: https://github.com/apache/hive/pull/4970#discussion_r1481076713
########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/service/CompactionHouseKeeperService.java: ########## @@ -0,0 +1,47 @@ +/* + * 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 + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * 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.metastore.txn.service; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; + +import java.util.concurrent.TimeUnit; + +/** + * Performs background tasks for Transaction management in Hive. + * Runs inside Hive Metastore Service. + */ +public class CompactionHouseKeeperService extends AcidHouseKeeperService { + + public CompactionHouseKeeperService() { + serviceName = this.getClass().getSimpleName(); + } + + @Override + public long runFrequency(TimeUnit unit) { + return MetastoreConf.getTimeVar(getConf(), MetastoreConf.ConfVars.COMPACTION_HOUSEKEEPER_SERVICE_INTERVAL, + unit); + } + + @Override + public void cleanTheHouse() { Review Comment: Done ########## standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java: ########## @@ -95,13 +95,16 @@ public class MetastoreConf { "org.apache.hadoop.hive.metastore.security.MetastoreDelegationTokenManager"; @VisibleForTesting static final String ACID_HOUSE_KEEPER_SERVICE_CLASS = - "org.apache.hadoop.hive.metastore.txn.AcidHouseKeeperService"; + "org.apache.hadoop.hive.metastore.txn.service.AcidHouseKeeperService"; + @VisibleForTesting + static final String COMPACTION_HOUSE_KEEPER_SERVICE_CLASS = Review Comment: Done ########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/service/AcidHouseKeeperService.java: ########## @@ -78,17 +81,13 @@ public void run() { } } - private void cleanTheHouse() { + protected void cleanTheHouse() { performTask(txnHandler::performTimeOuts, "Cleaning timed out txns and locks"); performTask(txnHandler::performWriteSetGC, "Cleaning obsolete write set entries"); performTask(txnHandler::cleanTxnToWriteIdTable, "Cleaning obsolete TXN_TO_WRITE_ID entries"); - if (isCompactorEnabled) { - performTask(txnHandler::removeDuplicateCompletedTxnComponents, "Cleaning duplicate COMPLETED_TXN_COMPONENTS entries"); - performTask(txnHandler::purgeCompactionHistory, "Cleaning obsolete compaction history entries"); - } } - private void performTask(FailableRunnable<MetaException> task, String description) { + void performTask(FailableRunnable<MetaException> task, String description) { long start = System.currentTimeMillis(); Functions.run(task); 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 --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org