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 sz...@apache.org on 2014/03/25 03:05:04 UTC

svn commit: r1581186 - in /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common: ./ src/ src/main/java/ src/main/java/org/apache/hadoop/fs/ src/main/java/org/apache/hadoop/fs/viewfs/ src/test/java/org/apache/hadoop/fs/

Author: szetszwo
Date: Tue Mar 25 02:05:03 2014
New Revision: 1581186

URL: http://svn.apache.org/r1581186
Log:
svn merge -c 1581183 from trunk for HADOOP-10425. LocalFileSystem.getContentSummary should not count crc files.

Modified:
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/   (props changed)
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt   (contents, props changed)
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/   (props changed)
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/   (props changed)
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java
    hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java

Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common:r1581183

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1581186&r1=1581185&r2=1581186&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Tue Mar 25 02:05:03 2014
@@ -141,6 +141,9 @@ Release 2.4.0 - UNRELEASED
 
     HADOOP-10422. Remove redundant logging of RPC retry attempts. (cnauroth)
 
+    HADOOP-10425. LocalFileSystem.getContentSummary should not count crc files.
+    (szetszwo)
+
   BREAKDOWN OF HADOOP-10184 SUBTASKS AND RELATED JIRAS
 
     HADOOP-10185. FileSystem API for ACLs. (cnauroth)

Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt:r1581183

Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src:r1581183

Propchange: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java:r1581183

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java?rev=1581186&r1=1581185&r2=1581186&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FilterFileSystem.java Tue Mar 25 02:05:03 2014
@@ -375,11 +375,6 @@ public class FilterFileSystem extends Fi
 
   // path variants delegate to underlying filesystem 
   @Override
-  public ContentSummary getContentSummary(Path f) throws IOException {
-    return fs.getContentSummary(f);
-  }
-
-  @Override
   public long getDefaultBlockSize(Path f) {
     return fs.getDefaultBlockSize(f);
   }

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java?rev=1581186&r1=1581185&r2=1581186&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ChRootedFileSystem.java Tue Mar 25 02:05:03 2014
@@ -320,7 +320,7 @@ class ChRootedFileSystem extends FilterF
 
   @Override
   public ContentSummary getContentSummary(Path f) throws IOException {
-    return super.getContentSummary(fullPath(f));
+    return fs.getContentSummary(fullPath(f));
   }
   
 

Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java?rev=1581186&r1=1581185&r2=1581186&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java (original)
+++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java Tue Mar 25 02:05:03 2014
@@ -33,6 +33,7 @@ import static org.junit.Assert.*;
 import static org.junit.Assume.assumeTrue;
 
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -203,12 +204,22 @@ public class TestLocalFileSystem {
   }
   
   @Test(timeout = 1000)
-  public void testMkdirs() throws IOException {
+  public void testCreateFileAndMkdirs() throws IOException {
     Path test_dir = new Path(TEST_ROOT_DIR, "test_dir");
-    Path test_file = new Path(TEST_ROOT_DIR, "file1");
+    Path test_file = new Path(test_dir, "file1");
     assertTrue(fileSys.mkdirs(test_dir));
    
-    writeFile(fileSys, test_file, 1);
+    final int fileSize = new Random().nextInt(1 << 20) + 1;
+    writeFile(fileSys, test_file, fileSize);
+
+    {
+      //check FileStatus and ContentSummary 
+      final FileStatus status = fileSys.getFileStatus(test_file);
+      Assert.assertEquals(fileSize, status.getLen());
+      final ContentSummary summary = fileSys.getContentSummary(test_dir);
+      Assert.assertEquals(fileSize, summary.getLength());
+    }
+    
     // creating dir over a file
     Path bad_dir = new Path(test_file, "another_dir");