Repository: hbase Updated Branches: refs/heads/master e75dee3a2 -> 5ebb25d60
HBASE-17347 ExportSnapshot may write snapshot info file to wrong directory when specifying target name (Jianwei Cui) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5ebb25d6 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5ebb25d6 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5ebb25d6 Branch: refs/heads/master Commit: 5ebb25d601e6b8b12c7cf52f5d6784d9363d6b4f Parents: e75dee3 Author: tedyu <[email protected]> Authored: Tue Dec 20 13:02:51 2016 -0800 Committer: tedyu <[email protected]> Committed: Tue Dec 20 13:02:51 2016 -0800 ---------------------------------------------------------------------- .../org/apache/hadoop/hbase/snapshot/ExportSnapshot.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/5ebb25d6/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 e8ca73e..a5507fc 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 @@ -1035,7 +1035,15 @@ public class ExportSnapshot extends AbstractHBaseTool implements Tool { .toBuilder() .setName(targetName) .build(); - SnapshotDescriptionUtils.writeSnapshotInfo(snapshotDesc, snapshotTmpDir, outputFs); + SnapshotDescriptionUtils.writeSnapshotInfo(snapshotDesc, initialOutputSnapshotDir, outputFs); + if (filesUser != null || filesGroup != null) { + outputFs.setOwner(new Path(initialOutputSnapshotDir, + SnapshotDescriptionUtils.SNAPSHOTINFO_FILE), filesUser, filesGroup); + } + if (filesMode > 0) { + outputFs.setPermission(new Path(initialOutputSnapshotDir, + SnapshotDescriptionUtils.SNAPSHOTINFO_FILE), new FsPermission((short)filesMode)); + } } // Step 2 - Start MR Job to copy files
