hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject svn commit: r1588280 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
Date Thu, 17 Apr 2014 15:15:08 GMT
Author: mbertozzi
Date: Thu Apr 17 15:15:08 2014
New Revision: 1588280

URL: http://svn.apache.org/r1588280
Log:
HBASE-11003 ExportSnapshot is using the wrong fs when staging dir is not in fs.defaultFS

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java?rev=1588280&r1=1588279&r2=1588280&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
Thu Apr 17 15:15:08 2014
@@ -535,11 +535,16 @@ public final class ExportSnapshot extend
     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 @@ public final class ExportSnapshot extend
   private static Path[] createInputFiles(final Configuration conf,
       final List<Pair<Path, Long>> 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<List<Path>> splits = getBalancedSplits(snapshotFiles, mappers);



Mime
View raw message