You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ha...@apache.org on 2008/10/14 23:46:27 UTC

svn commit: r704701 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/fs/ChecksumFileSystem.java src/test/org/apache/hadoop/fs/TestLocalFileSystem.java

Author: hairong
Date: Tue Oct 14 14:46:26 2008
New Revision: 704701

URL: http://svn.apache.org/viewvc?rev=704701&view=rev
Log:
Do not support append() for LocalFileSystem. Contributed by Hairong Kuang.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java
    hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystem.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=704701&r1=704700&r2=704701&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Tue Oct 14 14:46:26 2008
@@ -929,6 +929,8 @@
     HADOOP-4351. FSNamesystem.getBlockLocationsInternal throws
     ArrayIndexOutOfBoundsException. (hairong)
 
+    HADOOP-4292. Do not support append() for LocalFileSystem. (hairong)
+
 Release 0.18.1 - 2008-09-17
 
   IMPROVEMENTS

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java?rev=704701&r1=704700&r2=704701&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/fs/ChecksumFileSystem.java Tue Oct 14 14:46:26 2008
@@ -276,6 +276,12 @@
         new ChecksumFSInputChecker(this, f, bufferSize));
   }
 
+  /** {@inheritDoc} */
+  public FSDataOutputStream append(Path f, int bufferSize,
+      Progressable progress) throws IOException {
+    throw new IOException("Not supported");
+  }
+
   /**
    * Calculated the length of the checksum file in bytes.
    * @param size the length of the data file in bytes

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystem.java?rev=704701&r1=704700&r2=704701&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystem.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestLocalFileSystem.java Tue Oct 14 14:46:26 2008
@@ -153,60 +153,4 @@
     assertEquals(path.makeQualified(fs), status.getPath());
     cleanupFile(fs, path);
   }
-
-  /* Renaming this in order to temporarily disable the test
-   * until is append() is fixed for LocalFileSystem. See 
-   * HADOOP-4292.  
-   */
-  public void disabledTestAppend() throws IOException {
-    
-    Configuration conf = new Configuration();
-    final String dir = TEST_ROOT_DIR + "/append";
-    LocalFileSystem fs = FileSystem.getLocal(conf);
-
-    //normal case
-    {
-      Path f = new Path(dir, "f");
-      FSDataOutputStream out = fs.create(f);
-      out.writeBytes("something");
-      out.close();
-      assertEquals("something", readFile(fs, f));
-  
-      out = fs.append(f);
-      out.writeBytes(" more");
-      out.close();
-      assertEquals("something more", readFile(fs, f));
-  
-      out = fs.append(f);
-      out.writeBytes(" and more");
-      out.close();
-      assertEquals("something more and more", readFile(fs, f));
-
-      cleanupFile(fs, f);
-    }
-
-    //file not found case
-    {
-      Path f = new Path(dir, "fileNotFound");
-      try {
-        fs.append(f);
-        assertTrue(false);
-      }
-      catch(FileNotFoundException e) {
-        System.out.println("good: " + e);
-      }
-    }
-
-    //append to dir case
-    {
-      Path f = new Path(dir);
-      try {
-        fs.append(f);
-        assertTrue(false);
-      }
-      catch(IOException e) {
-        System.out.println("good: " + e);
-      }
-    }
-  }
 }