Browse Source

HADOOP-3390. Removed deprecated ClientProtocol.abandonFileInProgress(). (Tsz Wo (Nicholas), SZE via rangadi)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@656464 13f79535-47bb-0310-9956-ffa450edef68
Raghu Angadi 17 years ago
parent
commit
123a3213cd

+ 3 - 0
CHANGES.txt

@@ -51,6 +51,9 @@ Trunk (unreleased changes)
     Existing blocks get a generation stamp of 0. This is needed to support
     appends. (dhruba)
 
+    HADOOP-3390. Removed deprecated ClientProtocol.abandonFileInProgress().
+    (Tsz Wo (Nicholas), SZE via rangadi)
+
   NEW FEATURES
 
     HADOOP-3074. Provides a UrlStreamHandler for DFS and other FS,

+ 4 - 19
src/java/org/apache/hadoop/dfs/ClientProtocol.java

@@ -37,9 +37,9 @@ interface ClientProtocol extends VersionedProtocol {
    * Compared to the previous version the following changes have been introduced:
    * (Only the latest change is reflected.
    * The log of historical changes can be retrieved from the svn).
-   * 33 : Block generation stamp stored in Block
+   * 34 : remove abandonFileInProgress(...)
    */
-  public static final long versionID = 33L;
+  public static final long versionID = 34L;
   
   ///////////////////////////////////////
   // File contents
@@ -76,9 +76,8 @@ interface ClientProtocol extends VersionedProtocol {
    * <p>
    * Once created, the file is visible and available for read to other clients.
    * Although, other clients cannot {@link #delete(String)}, re-create or 
-   * {@link #rename(String, String)} it until the file is completed or 
-   * abandoned implicitely by {@link #abandonFileInProgress(String, String)}
-   * or explicitely as a result of lease expiration.
+   * {@link #rename(String, String)} it until the file is completed
+   * or explicitly as a result of lease expiration.
    * <p>
    * Blocks have a maximum size.  Clients that intend to
    * create multi-block files must also use {@link #addBlock(String, String)}.
@@ -159,20 +158,6 @@ interface ClientProtocol extends VersionedProtocol {
    */
   public LocatedBlock addBlock(String src, String clientName) throws IOException;
 
-  /**
-   * A client that wants to abandon writing to the current file
-   * should call abandonFileInProgress().  After this call, any
-   * client can call create() to obtain the filename.
-   * <p>
-   * Any blocks that have been written for the file will be 
-   * garbage-collected.
-   * @param src The filename
-   * @param holder The datanode holding the lease
-   */
-  @Deprecated
-  public void abandonFileInProgress(String src, 
-                                    String holder) throws IOException;
-
   /**
    * The client is done writing data to the given filename, and would 
    * like to complete it.  

+ 0 - 10
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -1084,16 +1084,6 @@ class FSNamesystem implements FSConstants, FSNamesystemMBean {
     return pendingFile;    
   }
 
-  /**
-   * Abandon the entire file in progress
-   */
-  public synchronized void abandonFileInProgress(String src, 
-                                                 String holder
-                                                 ) throws IOException {
-    NameNode.stateChangeLog.debug("DIR* NameSystem.abandonFileInProgress:" + src);
-    leaseManager.abandonLease(src, holder);
-  }
-
   /**
    * The FSNamesystem will already know the blocks that make up the file.
    * Before we return, we make sure that all the file's blocks have 

+ 0 - 18
src/java/org/apache/hadoop/dfs/LeaseManager.java

@@ -120,24 +120,6 @@ class LeaseManager {
     }
   }
 
-  synchronized void abandonLease(String src, String holder) throws IOException {
-    // find the lease
-    Lease lease = getLease(holder);
-    if (lease != null) {
-      // remove the file from the lease
-      if (lease.completedCreate(src)) {
-        // if we found the file in the lease, remove it from pendingCreates
-        fsnamesystem.internalReleaseCreate(src, holder);
-      } else {
-        LOG.warn("Attempt by " + holder + 
-                 " to release someone else's create lock on " + src);
-      }
-    } else {
-      LOG.warn("Attempt to release a lock from an unknown lease holder "
-               + holder + " for " + src);
-    }
-  }
-
   /************************************************************
    * A Lease governs all the locks held by a single client.
    * For each client there's a corresponding lease, whose

+ 2 - 10
src/java/org/apache/hadoop/dfs/NameNode.java

@@ -326,16 +326,8 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
       throw new IOException("Cannot abandon block during write to " + src);
     }
   }
-  /**
-   */
-  @Deprecated
-  public void abandonFileInProgress(String src, 
-                                    String holder) throws IOException {
-    stateChangeLog.debug("*DIR* NameNode.abandonFileInProgress:" + src);
-    namesystem.abandonFileInProgress(src, holder);
-  }
-  /**
-   */
+
+  /** {@inheritDoc} */
   public boolean complete(String src, String clientName) throws IOException {
     stateChangeLog.debug("*DIR* NameNode.complete: " + src + " for " + clientName);
     int returnCode = namesystem.completeFile(src, clientName);