[
https://issues.apache.org/jira/browse/HIVE-26711?focusedWorklogId=839528&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-839528
]
ASF GitHub Bot logged work on HIVE-26711:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Jan/23 08:08
Start Date: 17/Jan/23 08:08
Worklog Time Spent: 10m
Work Description: shreenidhiSaigaonkar commented on code in PR #3736:
URL: https://github.com/apache/hive/pull/3736#discussion_r1071876874
##########
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplWithReadOnlyHook.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.parse;
+
+import static
org.apache.hadoop.hive.ql.hooks.EnforceReadOnlyDatabaseHook.READONLY;
+import static org.apache.hadoop.hive.common.repl.ReplConst.READ_ONLY_HOOK;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
+import
org.apache.hadoop.hive.metastore.messaging.json.gzip.GzipJSONMessageEncoder;
+import org.apache.hadoop.hive.shims.Utils;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class TestReplWithReadOnlyHook extends
BaseReplicationScenariosAcidTables {
+
+ @BeforeClass
+ public static void classLevelSetup() throws Exception {
+ Map<String, String> overrides = new HashMap<>();
+ overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(),
+ GzipJSONMessageEncoder.class.getCanonicalName());
+
+ conf = new HiveConf(TestReplWithReadOnlyHook.class);
+ conf.set("hadoop.proxyuser." + Utils.getUGI().getShortUserName() +
".hosts", "*");
+
+ MiniDFSCluster miniDFSCluster =
+ new MiniDFSCluster.Builder(conf).numDataNodes(2).format(true).build();
+
+ Map<String, String> acidEnableConf = new HashMap<String, String>() {{
Review Comment:
Done
Issue Time Tracking
-------------------
Worklog Id: (was: 839528)
Time Spent: 1h 40m (was: 1.5h)
> The very first REPL Load should make the Target Database read-only
> ------------------------------------------------------------------
>
> Key: HIVE-26711
> URL: https://issues.apache.org/jira/browse/HIVE-26711
> Project: Hive
> Issue Type: Task
> Reporter: Shreenidhi
> Assignee: Shreenidhi
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> Use EnforceReadOnly hook to set TARGET database read only during BootStrap
> load.
> Also ensure backward compatibility.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)