Review Board 1.7.22


SQOOP-1226 --password-file option triggers FileSystemClosed exception at end of Oozie action

Review Request #15592 - Created Nov. 15, 2013 and updated

Jarek Cecho
SQOOP-1226
Reviewers
Sqoop
sqoop-trunk
I've discussed the issue with HDFS Committer Colin and he recommended us to remove the FileSystem#close call, so this patch is doing exactly this.
All unit tests seems to be passing.

Diff revision 2 (Latest)

1 2
1 2

  1. src/java/org/apache/sqoop/util/password/FilePasswordLoader.java: Loading...
src/java/org/apache/sqoop/util/password/FilePasswordLoader.java
Revision 86b71ec423b40eaa5b1aca30d00ba7ea1329728a New Change
[20] 76 lines
[+20] [+] protected void verifyPath(FileSystem fs, Path path) throws IOException {
77
  public String loadPassword(String p, Configuration configuration) throws IOException {
77
  public String loadPassword(String p, Configuration configuration) throws IOException {
78
    LOG.debug("Fetching password from specified path: " + p);
78
    LOG.debug("Fetching password from specified path: " + p);
79
    Path path = new Path(p);
79
    Path path = new Path(p);
80
    FileSystem fs = path.getFileSystem(configuration);
80
    FileSystem fs = path.getFileSystem(configuration);
81

    
   
81

   
82
    try {
82
    // Not closing FileSystem object because of SQOOP-1226
83
      verifyPath(fs, path);
83
    verifyPath(fs, path);
84
      return new String(readBytes(fs, path));
84
    return new String(readBytes(fs, path));
85
    } finally {

   
86
      fs.close();

   
87
    }

   
88
  }
85
  }
89
}
86
}
  1. src/java/org/apache/sqoop/util/password/FilePasswordLoader.java: Loading...