Index: src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java (revision 1587944) +++ src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java (working copy) @@ -535,11 +535,16 @@ return fileGroups; } - private static Path getInputFolderPath(final FileSystem fs, final Configuration conf) + private static Path getInputFolderPath(final Configuration conf) throws IOException, InterruptedException { String stagingName = "exportSnapshot-" + EnvironmentEdgeManager.currentTimeMillis(); - Path stagingDir = new Path(conf.get(CONF_STAGING_ROOT, fs.getWorkingDirectory().toString()) - , stagingName); + String stagingDirPath = conf.get(CONF_STAGING_ROOT); + if (stagingDirPath == null) { + stagingDirPath = FileSystem.get(conf).getWorkingDirectory().toString(); + } + + Path stagingDir = new Path(stagingDirPath, stagingName); + FileSystem fs = stagingDir.getFileSystem(conf); fs.mkdirs(stagingDir); return new Path(stagingDir, INPUT_FOLDER_PREFIX + String.valueOf(EnvironmentEdgeManager.currentTimeMillis())); @@ -554,8 +559,8 @@ private static Path[] createInputFiles(final Configuration conf, final List> snapshotFiles, int mappers) throws IOException, InterruptedException { - FileSystem fs = FileSystem.get(conf); - Path inputFolderPath = getInputFolderPath(fs, conf); + Path inputFolderPath = getInputFolderPath(conf); + FileSystem fs = inputFolderPath.getFileSystem(conf); LOG.debug("Input folder location: " + inputFolderPath); List> splits = getBalancedSplits(snapshotFiles, mappers);