Преглед изворни кода

HADOOP-4820. Remove unused method FSNamesystem::deleteInSafeMode. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@726098 13f79535-47bb-0310-9956-ffa450edef68
Christopher Douglas пре 16 година
родитељ
комит
c5f2424ffb

+ 3 - 0
CHANGES.txt

@@ -369,6 +369,9 @@ Trunk (unreleased changes)
     HADOOP-4855. Fixed command-specific help messages for refreshServiceAcl in
     DFSAdmin and MRAdmin. (acmurthy)
 
+    HADOOP-4820. Remove unused method FSNamesystem::deleteInSafeMode. (Suresh
+    Srinivas via cdouglas)
+
 Release 0.19.1 - Unreleased
 
   IMPROVEMENTS

+ 3 - 11
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -1622,7 +1622,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
       if ((!recursive) && (!dir.isDirEmpty(src))) {
         throw new IOException(src + " is non empty");
       }
-      boolean status = deleteInternal(src, true, true);
+      boolean status = deleteInternal(src, true);
       getEditLog().logSync();
       if (status && auditLog.isInfoEnabled()) {
         logAuditEvent(UserGroupInformation.getCurrentUGI(),
@@ -1632,24 +1632,16 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean {
       return status;
     }
     
-  /**
-   * An internal delete function that does not enforce safe mode
-   */
-  boolean deleteInSafeMode(String src) throws IOException {
-    boolean status = deleteInternal(src, false, false);
-    getEditLog().logSync();
-    return status;
-  }
   /**
    * Remove the indicated filename from the namespace.  This may
    * invalidate some blocks that make up the file.
    */
   synchronized boolean deleteInternal(String src, 
-      boolean enforceSafeMode, boolean enforcePermission) throws IOException {
+      boolean enforcePermission) throws IOException {
     if (NameNode.stateChangeLog.isDebugEnabled()) {
       NameNode.stateChangeLog.debug("DIR* NameSystem.delete: " + src);
     }
-    if (enforceSafeMode && isInSafeMode())
+    if (isInSafeMode())
       throw new SafeModeException("Cannot delete " + src, safeMode);
     if (enforcePermission && isPermissionEnabled) {
       checkPermission(src, false, null, FsAction.WRITE, null, FsAction.ALL);

+ 1 - 1
src/hdfs/org/apache/hadoop/hdfs/server/namenode/NamenodeFsck.java

@@ -300,7 +300,7 @@ public class NamenodeFsck {
         break;
       case FIXING_DELETE:
         if (!isOpen)
-          nn.namesystem.deleteInternal(path, true, false);
+          nn.namesystem.deleteInternal(path, false);
       }
     }
     if (showFiles) {