You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2015/09/16 23:15:27 UTC

hbase git commit: HBASE-13250 Revert due to compilation error against hadoop-1 profile

Repository: hbase
Updated Branches:
  refs/heads/0.98 bcd986e47 -> 38995fbd5


HBASE-13250 Revert due to compilation error against hadoop-1 profile


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/38995fbd
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/38995fbd
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/38995fbd

Branch: refs/heads/0.98
Commit: 38995fbd51ac4735b673dd1527cb2631b69b7474
Parents: bcd986e
Author: tedyu <yu...@gmail.com>
Authored: Wed Sep 16 14:15:24 2015 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Wed Sep 16 14:15:24 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/snapshot/ExportSnapshot.java   | 37 +-------------------
 1 file changed, 1 insertion(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/38995fbd/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
index 0cfeb75..dedb931 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
@@ -282,7 +282,7 @@ public class ExportSnapshot extends Configured implements Tool {
         context.getCounter(Counter.BYTES_EXPECTED).increment(inputStat.getLen());
 
         // Ensure that the output folder is there and copy the file
-        createOutputPath(outputPath.getParent());
+        outputFs.mkdirs(outputPath.getParent());
         FSDataOutputStream out = outputFs.create(outputPath, true);
         try {
           copyData(context, inputStat.getPath(), in, outputPath, out, inputStat.getLen());
@@ -300,23 +300,6 @@ public class ExportSnapshot extends Configured implements Tool {
     }
 
     /**
-     * Create the output folder and optionally set ownership.
-     */
-    private void createOutputPath(final Path path) throws IOException {
-      if (filesUser == null && filesGroup == null) {
-        outputFs.mkdirs(path);
-      } else {
-        Path parent = path.getParent();
-        if (!outputFs.exists(parent) && !parent.isRoot()) {
-          createOutputPath(parent);
-        }
-        outputFs.mkdirs(path);
-        // override the owner when non-null user/group is specified
-        outputFs.setOwner(path, filesUser, filesGroup);
-      }
-    }
-
-    /**
      * Try to Preserve the files attribute selected by the user copying them from the source file
      * This is only required when you are exporting as a different user than "hbase" or on a system
      * that doesn't have the "hbase" user.
@@ -820,21 +803,6 @@ public class ExportSnapshot extends Configured implements Tool {
   }
 
   /**
-   * Set path ownership.
-   */
-  private void setOwner(final FileSystem fs, final Path path, final String user,
-      final String group, final boolean recursive) throws IOException {
-    if (user != null || group != null) {
-      if (recursive && fs.isDirectory(path)) {
-        for (FileStatus child : fs.listStatus(path)) {
-          setOwner(fs, child.getPath(), user, group, recursive);
-        }
-      }
-      fs.setOwner(path, user, group);
-    }
-  }
-
-  /**
    * Execute the export snapshot by copying the snapshot metadata, hfiles and hlogs.
    * @return 0 on success, and != 0 upon failure.
    */
@@ -957,9 +925,6 @@ public class ExportSnapshot extends Configured implements Tool {
     try {
       LOG.info("Copy Snapshot Manifest");
       FileUtil.copy(inputFs, snapshotDir, outputFs, initialOutputSnapshotDir, false, false, conf);
-      if (filesUser != null || filesGroup != null) {
-        setOwner(outputFs, snapshotTmpDir, filesUser, filesGroup, true);
-      }
     } catch (IOException e) {
       throw new ExportSnapshotException("Failed to copy the snapshot directory: from=" +
         snapshotDir + " to=" + initialOutputSnapshotDir, e);