hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1125200 - in /hadoop/common/branches/yahoo-merge: CHANGES.txt src/java/org/apache/hadoop/fs/FileContext.java src/test/core/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java
Date Fri, 20 May 2011 01:34:02 GMT
Author: jitendra
Date: Fri May 20 01:34:01 2011
New Revision: 1125200

URL: http://svn.apache.org/viewvc?rev=1125200&view=rev
Log:
Merging change r1101570 for HADOOP-7268 from trunk.

Modified:
    hadoop/common/branches/yahoo-merge/CHANGES.txt
    hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileContext.java
    hadoop/common/branches/yahoo-merge/src/test/core/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java

Modified: hadoop/common/branches/yahoo-merge/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/yahoo-merge/CHANGES.txt?rev=1125200&r1=1125199&r2=1125200&view=diff
==============================================================================
--- hadoop/common/branches/yahoo-merge/CHANGES.txt (original)
+++ hadoop/common/branches/yahoo-merge/CHANGES.txt Fri May 20 01:34:01 2011
@@ -27,11 +27,12 @@ Trunk (unreleased changes)
     HADOOP-7223. FileContext createFlag combinations are not clearly defined.
     (suresh)
 
-
     HADOOP-7215. RPC clients must use network interface corresponding to 
     the host in the client's kerberos principal key. (suresh)
 
->>>>>>> .r1087843
+    HADOOP-7268. FileContext.getLocalFSFileContext() behavior needs to be 
+    fixed w.r.t tokens. (jitendra)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileContext.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileContext.java?rev=1125200&r1=1125199&r2=1125200&view=diff
==============================================================================
--- hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileContext.java (original)
+++ hadoop/common/branches/yahoo-merge/src/java/org/apache/hadoop/fs/FileContext.java Fri
May 20 01:34:01 2011
@@ -169,7 +169,6 @@ public final class FileContext {
   
   public static final Log LOG = LogFactory.getLog(FileContext.class);
   public static final FsPermission DEFAULT_PERM = FsPermission.getDefault();
-  volatile private static FileContext localFsSingleton = null;
   
   /**
    * List of files that should be deleted on JVM shutdown.
@@ -388,10 +387,7 @@ public final class FileContext {
    */
   public static FileContext getLocalFSFileContext()
       throws UnsupportedFileSystemException {
-    if (localFsSingleton == null) {
-      localFsSingleton = getFileContext(FsConstants.LOCAL_FS_URI); 
-    }
-    return localFsSingleton;
+    return getFileContext(FsConstants.LOCAL_FS_URI);
   }
 
   /**

Modified: hadoop/common/branches/yahoo-merge/src/test/core/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/yahoo-merge/src/test/core/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java?rev=1125200&r1=1125199&r2=1125200&view=diff
==============================================================================
--- hadoop/common/branches/yahoo-merge/src/test/core/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java
(original)
+++ hadoop/common/branches/yahoo-merge/src/test/core/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java
Fri May 20 01:34:01 2011
@@ -21,7 +21,9 @@ package org.apache.hadoop.fs;
 import java.io.IOException;
 
 import org.apache.hadoop.conf.Configuration;
+import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Test;
 
 public class TestLocalFSFileContextMainOperations extends FileContextMainOperationsBaseTest
{
 
@@ -37,4 +39,10 @@ public class TestLocalFSFileContextMainO
       wd = FileSystem.getLocal(new Configuration()).getWorkingDirectory();
     return wd;
   }
+  
+  @Test
+  public void testFileContextNoCache() throws UnsupportedFileSystemException {
+    FileContext fc1 = FileContext.getLocalFSFileContext();
+    Assert.assertTrue(fc1 != fc);
+  }
 }



Mime
View raw message