فهرست منبع

Merge -r 704700:704701 from trunk to main to move the changelog of HADOOP-4292.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.18@704708 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 16 سال پیش
والد
کامیت
26662cc497
3فایلهای تغییر یافته به همراه8 افزوده شده و 56 حذف شده
  1. 2 0
      CHANGES.txt
  2. 6 0
      src/core/org/apache/hadoop/fs/ChecksumFileSystem.java
  3. 0 56
      src/test/org/apache/hadoop/fs/TestLocalFileSystem.java

+ 2 - 0
CHANGES.txt

@@ -26,6 +26,8 @@ Release 0.18.2 - Unreleased
     HADOOP-4403. Make TestLeaseRecovery and TestFileCreation more robust.
     (szetszwo)
 
+    HADOOP-4292. Do not support append() for LocalFileSystem. (hairong)
+
   NEW FEATURES
 
     HADOOP-2421.  Add jdiff output to documentation, listing all API

+ 6 - 0
src/core/org/apache/hadoop/fs/ChecksumFileSystem.java

@@ -276,6 +276,12 @@ public abstract class ChecksumFileSystem extends FilterFileSystem {
         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

+ 0 - 56
src/test/org/apache/hadoop/fs/TestLocalFileSystem.java

@@ -153,60 +153,4 @@ public class TestLocalFileSystem extends TestCase {
     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);
-      }
-    }
-  }
 }