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

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

                Author: ASF GitHub Bot
            Created on: 04/May/21 18:53
            Start Date: 04/May/21 18:53
    Worklog Time Spent: 10m 
      Work Description: ayushtkn commented on a change in pull request #2043:
URL: https://github.com/apache/hive/pull/2043#discussion_r626026023



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplExternalTables.java
##########
@@ -162,7 +194,77 @@ private void dirLocationToCopy(String tableName, FileList 
fileList, Path sourceP
       targetPath = new Path(Utils.replaceHost(targetPath.toString(), 
sourcePath.toUri().getHost()));
       sourcePath = new Path(Utils.replaceHost(sourcePath.toString(), 
remoteNS));
     }
-    fileList.add(new DirCopyWork(tableName, sourcePath, 
targetPath).convertToString());
+    fileList.add(new DirCopyWork(tableName, sourcePath, targetPath, copyMode, 
snapshotPrefix).convertToString());
+  }
+
+  private SnapshotUtils.SnapshotCopyMode createSnapshotsAtSource(Path 
sourcePath, String snapshotPrefix,
+      boolean isSnapshotEnabled, HiveConf conf, 
SnapshotUtils.ReplSnapshotCount replSnapshotCount, FileList snapPathFileList,
+      ArrayList<String> prevSnaps, boolean isBootstrap) throws IOException {
+    if (!isSnapshotEnabled) {
+      LOG.info("Snapshot copy not enabled for path {} Will use normal distCp 
for copying data.", sourcePath);
+      return FALLBACK_COPY;
+    }
+    DistributedFileSystem sourceDfs = SnapshotUtils.getDFS(sourcePath, conf);
+    try {
+      if(isBootstrap) {
+        // Delete any pre existing snapshots.
+        SnapshotUtils.deleteSnapshotSafe(sourceDfs, sourcePath, 
firstSnapshot(snapshotPrefix));

Review comment:
       Changed behaviour, If it exists it will delete, and if the deletion 
fails, replication fails




-- 
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 592940)
    Time Spent: 3h 50m  (was: 3h 40m)

> Add support for Snapshots during external table replication
> -----------------------------------------------------------
>
>                 Key: HIVE-24852
>                 URL: https://issues.apache.org/jira/browse/HIVE-24852
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: Design Doc HDFS Snapshots for External Table 
> Replication-01.pdf
>
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> Add support for use of snapshot diff for external table replication.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to