You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/23 07:33:35 UTC

[GitHub] [hive] pkumarsinha commented on a change in pull request #2005: HIVE-24783: Store currentNotificationID on target during repl load op.

pkumarsinha commented on a change in pull request #2005:
URL: https://github.com/apache/hive/pull/2005#discussion_r580814932



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java
##########
@@ -499,6 +500,20 @@ private void dropTablesExcludedInReplScope(ReplScope replScope) throws HiveExcep
         dbName);
   }
 
+  private void createNotificationFileTask() {
+    if ((work.isIncrementalLoad() && !work.incrementalLoadTasksBuilder().hasMoreWork() && !work.hasBootstrapLoadTasks())

Review comment:
       Can simplify the condition:
   !work.hasBootstrapLoadTasks() is required condition on both side of ||

##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
##########
@@ -162,6 +162,23 @@ public void testAcidTablesBootstrap() throws Throwable {
     verifyInc2Load(replicatedDbName, inc2Dump.lastReplicationId);
   }
 
+  @Test
+  public void testAcidNotification() throws Throwable{
+    // Bootstrap
+    WarehouseInstance.Tuple bootstrapDump = prepareDataAndDump(primaryDbName, null);
+    replica.load(replicatedDbName, primaryDbName);
+    verifyBootLoadNotification(replicatedDbName, bootstrapDump.lastReplicationId, bootstrapDump.dumpLocation, true);
+

Review comment:
       nit:Remove this extra line

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/NotificationFileTask.java
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.exec.repl;
+
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
+import org.apache.hadoop.hive.ql.exec.Task;
+import org.apache.hadoop.hive.ql.parse.repl.dump.Utils;
+import org.apache.hadoop.hive.ql.plan.api.StageType;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.Serializable;
+
+public class NotificationFileTask extends Task<NotificationFileWork> implements Serializable {

Review comment:
       Did you explore if we can do it in a LoadAckTask itself?

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java
##########
@@ -352,6 +352,7 @@ a database ( directory )
     context.getFsScratchDirs().putAll(loadContext.pathInfo.getFsScratchDirs());
     if (!HiveConf.getBoolVar(conf, REPL_DUMP_SKIP_IMMUTABLE_DATA_COPY)) {
       createReplLoadCompleteAckTask();
+      createNotificationFileTask();

Review comment:
       Shouldn't ack creation be the last thing?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org