rda3mon commented on a change in pull request #3279:
URL: https://github.com/apache/hbase/pull/3279#discussion_r637350077



##########
File path: 
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java
##########
@@ -240,13 +240,13 @@ protected void copyMetaData(FileSystem fs, Path 
tmpBackupDir, Path backupDirPath
    * @throws IOException exception
    */
   protected void copyFile(FileSystem fs, Path p, Path newPath) throws 
IOException {
-    File f = File.createTempFile("data", "meta");
-    Path localPath = new Path(f.getAbsolutePath());
-    fs.copyToLocalFile(p, localPath);
-    fs.copyFromLocalFile(localPath, newPath);
-    boolean exists = fs.exists(newPath);
-    if (!exists) {
-      throw new IOException("Failed to copy meta file to: "+ newPath);
+    try (InputStream in = fs.open(p);
+      OutputStream out = fs.create(newPath, true)) {
+      IOUtils.copy(in, out);
+      boolean exists = fs.exists(newPath);

Review comment:
       missed this. my bad.
   
   Fixed.




-- 
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]


Reply via email to