hive-gitbox mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hive] ayushtkn commented on a change in pull request #2043: HIVE-24852. Add support for Snapshots during external table replication.
Date Tue, 04 May 2021 18:53:11 GMT

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



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


Mime
View raw message