Author: tomwhite Date: Sun Mar 25 07:31:22 2007 New Revision: 522268 URL: http://svn.apache.org/viewvc?view=rev&rev=522268 Log: HADOOP-1131. Add a closeAll() static method to FileSystem. Contributed by Philippe Gassmann.
Modified: lucene/hadoop/trunk/CHANGES.txt lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileSystem.java Modified: lucene/hadoop/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=522268&r1=522267&r2=522268 ============================================================================== --- lucene/hadoop/trunk/CHANGES.txt (original) +++ lucene/hadoop/trunk/CHANGES.txt Sun Mar 25 07:31:22 2007 @@ -37,6 +37,9 @@ 11. HADOOP-1122. Fix divide-by-zero exception in FSNamesystem chooseTarget method. (Dhruba Borthakur via tomwhite) +12. HADOOP-1131. Add a closeAll() static method to FileSystem. + (Philippe Gassmann via tomwhite) + Release 0.12.2 - 2007-23-17 Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileSystem.java URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileSystem.java?view=diff&rev=522268&r1=522267&r2=522268 ============================================================================== --- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileSystem.java (original) +++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/FileSystem.java Sun Mar 25 07:31:22 2007 @@ -164,6 +164,20 @@ return fs; } + /** + * Close all cached filesystems. Be sure those filesystems are not + * used anymore. + * + * @throws IOException + */ + public static synchronized void closeAll() throws IOException{ + for(Map<String, FileSystem> fss : CACHE.values()){ + for(FileSystem fs : fss.values()){ + fs.close(); + } + } + } + /** Make sure that a path specifies a FileSystem. */ public Path makeQualified(Path path) { checkPath(path);