sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1196980 - in /incubator/sqoop/trunk/src/java/org/apache/sqoop: io/SplittingOutputStream.java util/DirectImportUtils.java
Date Thu, 03 Nov 2011 07:10:51 GMT
Author: blee
Date: Thu Nov  3 07:10:50 2011
New Revision: 1196980

URL: http://svn.apache.org/viewvc?rev=1196980&view=rev
Log:
SQOOP-373 Can only write to default file system on direct import

Modified:
    incubator/sqoop/trunk/src/java/org/apache/sqoop/io/SplittingOutputStream.java
    incubator/sqoop/trunk/src/java/org/apache/sqoop/util/DirectImportUtils.java

Modified: incubator/sqoop/trunk/src/java/org/apache/sqoop/io/SplittingOutputStream.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/org/apache/sqoop/io/SplittingOutputStream.java?rev=1196980&r1=1196979&r2=1196980&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/org/apache/sqoop/io/SplittingOutputStream.java (original)
+++ incubator/sqoop/trunk/src/java/org/apache/sqoop/io/SplittingOutputStream.java Thu Nov
 3 07:10:50 2011
@@ -79,8 +79,6 @@ public class SplittingOutputStream exten
   /** Initialize the OutputStream to the next file to write to.
    */
   private void openNextFile() throws IOException {
-    FileSystem fs = FileSystem.get(conf);
-
     StringBuffer sb = new StringBuffer();
     Formatter fmt = new Formatter(sb);
     fmt.format("%05d", this.fileNum++);
@@ -89,6 +87,7 @@ public class SplittingOutputStream exten
       filename = filename + codec.getDefaultExtension();
     }
     Path destFile = new Path(destDir, filename);
+    FileSystem fs = destFile.getFileSystem(conf);
     LOG.debug("Opening next output file: " + destFile);
     if (fs.exists(destFile)) {
       Path canonicalDest = destFile.makeQualified(fs);

Modified: incubator/sqoop/trunk/src/java/org/apache/sqoop/util/DirectImportUtils.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/org/apache/sqoop/util/DirectImportUtils.java?rev=1196980&r1=1196979&r2=1196980&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/org/apache/sqoop/util/DirectImportUtils.java (original)
+++ incubator/sqoop/trunk/src/java/org/apache/sqoop/util/DirectImportUtils.java Thu Nov  3
07:10:50 2011
@@ -77,10 +77,10 @@ public final class DirectImportUtils {
   public static SplittableBufferedWriter createHdfsSink(Configuration conf,
       SqoopOptions options, ImportJobContext context) throws IOException {
 
-    FileSystem fs = FileSystem.get(conf);
     Path destDir = context.getDestination();
+    FileSystem fs = destDir.getFileSystem(conf);
 
-    LOG.debug("Writing to filesystem: " + conf.get("fs.default.name"));
+    LOG.debug("Writing to filesystem: " + fs.getUri());
     LOG.debug("Creating destination directory " + destDir);
     fs.mkdirs(destDir);
 



Mime
View raw message