hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r494604 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/s3/S3FileSystem.java src/test/org/apache/hadoop/fs/s3/S3FileSystemBaseTest.java
Date Tue, 09 Jan 2007 21:43:09 GMT
Author: cutting
Date: Tue Jan  9 13:43:08 2007
New Revision: 494604

URL: http://svn.apache.org/viewvc?view=rev&rev=494604
Log:
HADOOP-865.  Fix S3 FileSystem so that partially created files can be deleted.  Contributed
by Tom White.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/s3/S3FileSystem.java
    lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/s3/S3FileSystemBaseTest.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=494604&r1=494603&r2=494604
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Jan  9 13:43:08 2007
@@ -26,6 +26,9 @@
  8. HADOOP-868.  Decrease the number of open files during map,
     respecting io.sort.factor.  (Devaraj Das via cutting)
 
+ 9. HADOOP-865.  Fix S3 FileSystem so that partially created files can
+    be deleted.  (Tom White via cutting)
+
 
 Release 0.10.0 - 2007-01-05
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/s3/S3FileSystem.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/s3/S3FileSystem.java?view=diff&rev=494604&r1=494603&r2=494604
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/s3/S3FileSystem.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/fs/s3/S3FileSystem.java Tue Jan  9 13:43:08
2007
@@ -192,7 +192,7 @@
     Path absolutePath = makeAbsolute(path);
     INode inode = store.getINode(absolutePath);
     if (inode == null) {
-      throw new IOException("No such file or directory.");
+      return false;
     }
     store.deleteINode(absolutePath);
     if (inode.isFile()) {

Modified: lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/s3/S3FileSystemBaseTest.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/s3/S3FileSystemBaseTest.java?view=diff&rev=494604&r1=494603&r2=494604
==============================================================================
--- lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/s3/S3FileSystemBaseTest.java (original)
+++ lucene/hadoop/trunk/src/test/org/apache/hadoop/fs/s3/S3FileSystemBaseTest.java Tue Jan
 9 13:43:08 2007
@@ -199,7 +199,12 @@
     assertEquals("Length", BLOCK_SIZE, s3FileSystem.getLength(path));
     assertTrue("Parent exists", s3FileSystem.exists(path.getParent()));
   }
-
+  
+  public void testDeleteNonExistentFile() throws IOException {
+    Path path = new Path("/test/hadoop/file");    
+    assertFalse("Doesn't exist", s3FileSystem.exists(path));
+    assertFalse("No deletion", s3FileSystem.delete(path));
+  }
 
   public void testRename() throws Exception {
     int len = BLOCK_SIZE;



Mime
View raw message