[ https://issues.apache.org/jira/browse/HIVE-22997?focusedWorklogId=407359&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-407359 ]
ASF GitHub Bot logged work on HIVE-22997: ----------------------------------------- Author: ASF GitHub Bot Created on: 21/Mar/20 02:29 Start Date: 21/Mar/20 02:29 Worklog Time Spent: 10m Work Description: pkumarsinha commented on pull request #951: HIVE-22997 : Copy external table to target during Repl Dump operation URL: https://github.com/apache/hive/pull/951#discussion_r395952920 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java ########## @@ -122,33 +128,38 @@ public String getName() { @Override public int execute() { try { - Hive hiveDb = getHive(); - Path dumpRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLDIR), - Base64.getEncoder().encodeToString(work.dbNameOrPattern.toLowerCase() - .getBytes(StandardCharsets.UTF_8.name()))); - Path previousDumpMetaPath = getPreviousDumpMetadataPath(dumpRoot); - Path previousHiveDumpPath = - previousDumpMetaPath != null ? new Path(previousDumpMetaPath, ReplUtils.REPL_HIVE_BASE_DIR) : null; - //If no previous dump is present or previous dump was loaded, proceed - if (shouldDump(previousHiveDumpPath)) { - Path currentDumpPath = new Path(dumpRoot, getNextDumpDir()); - Path hiveDumpRoot = new Path(currentDumpPath, ReplUtils.REPL_HIVE_BASE_DIR); - DumpMetaData dmd = new DumpMetaData(hiveDumpRoot, conf); - // Initialize ReplChangeManager instance since we will require it to encode file URI. - ReplChangeManager.getInstance(conf); - Path cmRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLCMDIR)); - Long lastReplId; - if (previousHiveDumpPath == null) { - lastReplId = bootStrapDump(hiveDumpRoot, dmd, cmRoot, hiveDb); + if (work.dirCopyIteratorInitialized() || work.replPathIteratorInitialized()) { + intitiateDataCopyTasks(); + } else { + Hive hiveDb = getHive(); + Path dumpRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLDIR), + Base64.getEncoder().encodeToString(work.dbNameOrPattern.toLowerCase() + .getBytes(StandardCharsets.UTF_8.name()))); + Path previousDumpMetaPath = getPreviousDumpMetadataPath(dumpRoot); + Path previousHiveDumpPath = + previousDumpMetaPath != null ? new Path(previousDumpMetaPath, ReplUtils.REPL_HIVE_BASE_DIR) : null; + //If no previous dump is present or previous dump was loaded, proceed + if (shouldDump(previousHiveDumpPath)) { + Path currentDumpPath = new Path(dumpRoot, getNextDumpDir()); + Path hiveDumpRoot = new Path(currentDumpPath, ReplUtils.REPL_HIVE_BASE_DIR); + DumpMetaData dmd = new DumpMetaData(hiveDumpRoot, conf); + // Initialize ReplChangeManager instance since we will require it to encode file URI. + ReplChangeManager.getInstance(conf); + Path cmRoot = new Path(conf.getVar(HiveConf.ConfVars.REPLCMDIR)); + Long lastReplId; + if (previousHiveDumpPath == null) { + lastReplId = bootStrapDump(hiveDumpRoot, dmd, cmRoot, hiveDb); + } else { + work.setEventFrom(getEventFromPreviousDumpMetadata(previousHiveDumpPath)); + lastReplId = incrementalDump(hiveDumpRoot, dmd, cmRoot, hiveDb); + } + work.setResultValues(Arrays.asList(currentDumpPath.toUri().toString(), String.valueOf(lastReplId))); + deleteAllPreviousDumpMeta(dumpRoot, currentDumpPath); + work.setDumpAckFile(new Path(hiveDumpRoot, ReplUtils.DUMP_ACKNOWLEDGEMENT)); + intitiateDataCopyTasks(); } else { - work.setEventFrom(getEventFromPreviousDumpMetadata(previousHiveDumpPath)); - lastReplId = incrementalDump(hiveDumpRoot, dmd, cmRoot, hiveDb); + LOG.warn("Previous Dump is not yet loaded"); } - prepareReturnValues(Arrays.asList(currentDumpPath.toUri().toString(), String.valueOf(lastReplId))); - writeDumpCompleteAck(hiveDumpRoot); - deleteAllPreviousDumpMeta(dumpRoot, currentDumpPath); - } else { - LOG.warn("Previous Dump is not yet loaded"); 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 407359) > Copy external table to target during Repl Dump operation > -------------------------------------------------------- > > Key: HIVE-22997 > URL: https://issues.apache.org/jira/browse/HIVE-22997 > Project: Hive > Issue Type: Task > Reporter: PRAVIN KUMAR SINHA > Assignee: PRAVIN KUMAR SINHA > Priority: Major > Labels: pull-request-available > Attachments: HIVE-22997.03.patch, HIVE-22997.04.patch, > HIVE-22997.1.patch, HIVE-22997.10.patch, HIVE-22997.11.patch, > HIVE-22997.12.patch, HIVE-22997.13.patch, HIVE-22997.14.patch, > HIVE-22997.15.patch, HIVE-22997.16.patch, HIVE-22997.2.patch, > HIVE-22997.4.patch, HIVE-22997.5.patch, HIVE-22997.6.patch, > HIVE-22997.7.patch, HIVE-22997.8.patch, HIVE-22997.9.patch > > Time Spent: 8h 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)