hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r937093 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/FilterFs.java src/test/core/org/apache/hadoop/fs/TestFilterFs.java
Date Thu, 22 Apr 2010 22:47:44 GMT
Author: dhruba
Date: Thu Apr 22 22:47:44 2010
New Revision: 937093

URL: http://svn.apache.org/viewvc?rev=937093&view=rev
Log:
HADOOP-6719. Insert all missing methods in FilterFs.
(Rodrigo Schmidt via dhruba)


Added:
    hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFilterFs.java
Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/fs/FilterFs.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=937093&r1=937092&r2=937093&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Thu Apr 22 22:47:44 2010
@@ -336,6 +336,9 @@ Trunk (unreleased changes)
     HADOOP-6690. FilterFileSystem correctly handles setTimes call.
     (Rodrigo Schmidt via dhruba)
 
+    HADOOP-6719. Insert all missing methods in FilterFs.
+    (Rodrigo Schmidt via dhruba)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/fs/FilterFs.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/fs/FilterFs.java?rev=937093&r1=937092&r2=937093&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/fs/FilterFs.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/fs/FilterFs.java Thu Apr 22 22:47:44 2010
@@ -16,13 +16,17 @@ package org.apache.hadoop.fs;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.EnumSet;
 
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.fs.FileSystem.Statistics;
 import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.security.AccessControlException;
 import org.apache.hadoop.util.Progressable;
 
 /**
@@ -52,11 +56,21 @@ public abstract class FilterFs extends A
   }
 
   @Override
+  protected Statistics getStatistics() {
+    return myFs.getStatistics();
+  }
+
+  @Override
   protected Path getInitialWorkingDirectory() {
     return myFs.getInitialWorkingDirectory();
   }
   
   @Override
+  protected Path getHomeDirectory() {
+    return myFs.getHomeDirectory();
+  }
+  
+  @Override
   protected FSDataOutputStream createInternal(Path f,
     EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize,
     short replication, long blockSize, Progressable progress,
@@ -103,6 +117,12 @@ public abstract class FilterFs extends A
   }
   
   @Override
+  protected FsStatus getFsStatus(final Path f) throws AccessControlException,
+    FileNotFoundException, UnresolvedLinkException, IOException {
+    return myFs.getFsStatus(f);
+  }
+
+  @Override
   protected FsStatus getFsStatus() throws IOException {
     return myFs.getFsStatus();
   }
@@ -118,6 +138,21 @@ public abstract class FilterFs extends A
   }
 
   @Override
+  protected URI getUri() {
+    return myFs.getUri();
+  }
+  
+  @Override
+  protected void checkPath(Path path) {
+    myFs.checkPath(path);
+  }
+  
+  @Override
+  protected String getUriPath(final Path p) {
+    return myFs.getUriPath(p);
+  }
+  
+  @Override
   protected FileStatus[] listStatus(Path f) 
       throws IOException, UnresolvedLinkException {
     checkPath(f);
@@ -133,6 +168,13 @@ public abstract class FilterFs extends A
   }
 
   @Override
+  protected FSDataInputStream open(final Path f) throws AccessControlException,
+    FileNotFoundException, UnresolvedLinkException, IOException {
+    checkPath(f);
+    return myFs.open(f);
+  }
+
+  @Override
   protected FSDataInputStream open(Path f, int bufferSize) 
     throws IOException, UnresolvedLinkException {
     checkPath(f);
@@ -148,6 +190,14 @@ public abstract class FilterFs extends A
   }
 
   @Override
+  protected void renameInternal(final Path src, final Path dst,
+      boolean overwrite) throws AccessControlException,
+      FileAlreadyExistsException, FileNotFoundException,
+      ParentNotDirectoryException, UnresolvedLinkException, IOException {
+    myFs.renameInternal(src, dst, overwrite);
+  }
+  
+  @Override
   protected void setOwner(Path f, String username, String groupname)
     throws IOException, UnresolvedLinkException {
     checkPath(f);

Added: hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFilterFs.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFilterFs.java?rev=937093&view=auto
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFilterFs.java (added)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFilterFs.java Thu Apr 22 22:47:44
2010
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.fs;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.URI;
+
+import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+
+public class TestFilterFs extends TestCase {
+
+  private static final Log LOG = FileSystem.LOG;
+
+  public static class DontCheck {
+    public void checkScheme(URI uri, String supportedScheme) { }
+  }
+  
+  public void testFilterFileSystem() throws Exception {
+    for (Method m : AbstractFileSystem.class.getDeclaredMethods()) {
+      if (Modifier.isStatic(m.getModifiers()))
+        continue;
+      if (Modifier.isPrivate(m.getModifiers()))
+        continue;
+      if (Modifier.isFinal(m.getModifiers()))
+        continue;
+      
+      try {
+        DontCheck.class.getMethod(m.getName(), m.getParameterTypes());
+        LOG.info("Skipping " + m);
+      } catch (NoSuchMethodException exc) {
+        LOG.info("Testing " + m);
+        try{
+          FilterFs.class.getDeclaredMethod(m.getName(), m.getParameterTypes());
+        }
+        catch(NoSuchMethodException exc2){
+          LOG.error("FilterFileSystem doesn't implement " + m);
+          throw exc2;
+        }
+      }
+    }
+  }
+  
+}



Mime
View raw message