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

ASF GitHub Bot logged work on HIVE-21841:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Jun/19 06:47
            Start Date: 17/Jun/19 06:47
    Worklog Time Spent: 10m 
      Work Description: ashutosh-bapat commented on pull request #668: 
HIVE-21841 : Add configuration to specify the hostname of HMS leader …to run 
housekeeping tasks in.
URL: https://github.com/apache/hive/pull/668#discussion_r294154318
 
 

 ##########
 File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetastoreHousekeepingLeader.java
 ##########
 @@ -0,0 +1,61 @@
+/*
+ * 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.metastore;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Map;
+
+/**
+ * Test for specifying a valid hostname as HMS leader.
+ */
+public class TestMetastoreHousekeepingLeader extends 
MetastoreHousekeepingLeaderTestBase {
+  private static final Logger LOG = 
LoggerFactory.getLogger(TestMetastoreHousekeepingLeader.class);
+
+  @Before
+  public void setUp() throws Exception {
+    internalSetup("localhost");
 
 Review comment:
   In a test, a metastore is started within the same JVM so just stopping the 
metastore doesn't stop all the threads it runs. Junit takes care of that when 
running different tests. So, if we add all the scenarios in the same test, we 
wouldn't know whether a housekeeping thread was started by previous test 
invocation or current test invocation. Basically a bug in stopMetastore() would 
be masked. It's better to not go that route. Having separate tests for each 
scenario is much cleaner.
 
----------------------------------------------------------------
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: 261193)
    Time Spent: 2.5h  (was: 2h 20m)

> Leader election in HMS to run housekeeping tasks.
> -------------------------------------------------
>
>                 Key: HIVE-21841
>                 URL: https://issues.apache.org/jira/browse/HIVE-21841
>             Project: Hive
>          Issue Type: New Feature
>    Affects Versions: 4.0.0
>            Reporter: Ashutosh Bapat
>            Assignee: Ashutosh Bapat
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>         Attachments: HIVE-21841.01.patch, HIVE-21841.02.patch
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> HMS performs housekeeping tasks. When there are multiple HMSes we need to 
> have a leader HMS elected which will carry out those housekeeping tasks. 
> These tasks include execution of compaction tasks, auto-discovering 
> partitions for external tables, generation of compaction tasks, repl thread 
> etc.
> Note that, though the code for compaction tasks, auto-discovery of partitions 
> etc. is in Hive, the actual tasks are initiated by an HMS configured to do 
> so. So, leader election is required only for HMS and not for HS2.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to