hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r815809 - in /hadoop/common/trunk: CHANGES.txt src/test/core/org/apache/hadoop/fs/TestFileSystem.java src/test/core/org/apache/hadoop/fs/TestFileSystemCaching.java
Date Wed, 16 Sep 2009 14:41:08 GMT
Author: tomwhite
Date: Wed Sep 16 14:41:08 2009
New Revision: 815809

URL: http://svn.apache.org/viewvc?rev=815809&view=rev
Log:
HADOOP-6257. Two TestFileSystem classes are confusing hadoop-hdfs-hdfwithmr. Contributed by
Philip Zeyliger.

Added:
    hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFileSystemCaching.java
Removed:
    hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFileSystem.java
Modified:
    hadoop/common/trunk/CHANGES.txt

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=815809&r1=815808&r2=815809&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Wed Sep 16 14:41:08 2009
@@ -1024,6 +1024,9 @@
     HADOOP-6250. Modify test-patch to delete copied XML files before running
     patch build. (Rahul Kumar Singh via yhemanth)
 
+    HADOOP-6257. Two TestFileSystem classes are confusing
+    hadoop-hdfs-hdfwithmr. (Philip Zeyliger via tomwhite)
+
 Release 0.20.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Added: hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFileSystemCaching.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFileSystemCaching.java?rev=815809&view=auto
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFileSystemCaching.java (added)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestFileSystemCaching.java Wed
Sep 16 14:41:08 2009
@@ -0,0 +1,50 @@
+/**
+ * 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 static junit.framework.Assert.assertSame;
+import static junit.framework.Assert.assertNotSame;
+
+import java.net.URI;
+
+import org.apache.hadoop.conf.Configuration;
+import org.junit.Test;
+
+public class TestFileSystemCaching {
+
+  @Test
+  public void testCacheEnabled() throws Exception {
+    Configuration conf = new Configuration();
+    conf.set("fs.cachedfile.impl", conf.get("fs.file.impl"));
+    FileSystem fs1 = FileSystem.get(new URI("cachedfile://a"), conf);
+    FileSystem fs2 = FileSystem.get(new URI("cachedfile://a"), conf);
+    assertSame(fs1, fs2);
+  }
+
+  @Test
+  public void testCacheDisabled() throws Exception {
+    Configuration conf = new Configuration();
+    conf.set("fs.uncachedfile.impl", conf.get("fs.file.impl"));
+    conf.setBoolean("fs.uncachedfile.impl.disable.cache", true);
+    FileSystem fs1 = FileSystem.get(new URI("uncachedfile://a"), conf);
+    FileSystem fs2 = FileSystem.get(new URI("uncachedfile://a"), conf);
+    assertNotSame(fs1, fs2);
+  }
+
+}



Mime
View raw message