Author: szetszwo
Date: Thu May 14 20:22:13 2009
New Revision: 774912

URL: http://svn.apache.org/viewvc?rev=774912&view=rev
Log:
HADOOP-5818. Revert the renaming from FSNamesystem.checkSuperuserPrivilege to 
checkAccess by HADOOP-5643.  Contributed by Amar Kamat

Modified:
    hadoop/core/trunk/CHANGES.txt
    
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=774912&r1=774911&r2=774912&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu May 14 20:22:13 2009
@@ -579,6 +579,9 @@
 
     HADOOP-5203. TT's version build is too restrictive. (Rick Cox via sharad)
 
+    HADOOP-5818. Revert the renaming from FSNamesystem.checkSuperuserPrivilege
+    to checkAccess by HADOOP-5643.  (Amar Kamat via szetszwo)
+
 Release 0.20.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: 
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: 
http://svn.apache.org/viewvc/hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=774912&r1=774911&r2=774912&view=diff
==============================================================================
--- 
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
 (original)
+++ 
hadoop/core/trunk/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
 Thu May 14 20:22:13 2009
@@ -471,7 +471,7 @@
    * Dump all metadata into specified file
    */
   synchronized void metaSave(String filename) throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     File file = new File(System.getProperty("hadoop.log.dir"), 
                          filename);
     PrintWriter out = new PrintWriter(new BufferedWriter(
@@ -514,7 +514,7 @@
    */
   synchronized BlocksWithLocations getBlocks(DatanodeID datanode, long size)
       throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
 
     DatanodeDescriptor node = getDatanode(datanode);
     if (node == null) {
@@ -1486,7 +1486,7 @@
    */
   void setQuota(String path, long nsQuota, long dsQuota) throws IOException {
     if (isPermissionEnabled) {
-      checkAccess();
+      checkSuperuserPrivilege();
     }
     
     dir.setQuota(path, nsQuota, dsQuota);
@@ -2537,7 +2537,7 @@
 
   public synchronized DatanodeInfo[] datanodeReport( DatanodeReportType type
       ) throws AccessControlException {
-    checkAccess();
+    checkSuperuserPrivilege();
 
     ArrayList<DatanodeDescriptor> results = getDatanodeListForReport(type);
     DatanodeInfo[] arr = new DatanodeInfo[results.size()];
@@ -2556,7 +2556,7 @@
    * @throws IOException if 
    */
   synchronized void saveNamespace() throws AccessControlException, IOException 
{
-    checkAccess();
+    checkSuperuserPrivilege();
     if(!isInSafeMode()) {
       throw new IOException("Safe mode should be turned ON " +
                             "in order to create namespace image.");
@@ -2572,7 +2572,7 @@
    * @throws AccessControlException if superuser privilege is violated.
    */
   synchronized boolean restoreFailedStorage(String arg) throws 
AccessControlException {
-    checkAccess();
+    checkSuperuserPrivilege();
     
     // if it is disabled - enable it and vice versa.
     if(arg.equals("check"))
@@ -2748,7 +2748,7 @@
    * 4. Removed from exclude --> stop decommission.
    */
   public void refreshNodes(Configuration conf) throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     // Reread the config to get dfs.hosts and dfs.hosts.exclude filenames.
     // Update the file names and refresh internal includes and excludes list
     if (conf == null)
@@ -2782,7 +2782,7 @@
   }
     
   void finalizeUpgrade() throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     getFSImage().finalizeUpgrade();
   }
 
@@ -3233,7 +3233,7 @@
     
   boolean setSafeMode(SafeModeAction action) throws IOException {
     if (action != SafeModeAction.SAFEMODE_GET) {
-      checkAccess();
+      checkSuperuserPrivilege();
       switch(action) {
       case SAFEMODE_LEAVE: // leave safe mode
         leaveSafeMode(false);
@@ -3433,7 +3433,7 @@
     return checkPermission(path, false, null, null, null, null);
   }
 
-  private void checkAccess() throws AccessControlException {
+  private void checkSuperuserPrivilege() throws AccessControlException {
     if (isPermissionEnabled) {
       PermissionChecker.checkSuperuserPrivilege(fsOwner, supergroup);
     }


Reply via email to