Przeglądaj źródła

HADOOP-726. Deprecate FileSystem locking methods. Contributed by Raghu.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@499970 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 lat temu
rodzic
commit
2c96e34ff6

+ 4 - 0
CHANGES.txt

@@ -107,6 +107,10 @@ Release 0.10.1 - 2007-01-10
     under-replicated should be further replicated before blocks which
     are less under-replicated.  (Hairong Kuang via cutting)
 
+15. HADOOP-726.  Deprecate FileSystem locking methods.  They are not
+    currently usable.  Locking should eventually provided as an
+    independent service.  (Raghu Angadi via cutting)
+
 
 Release 0.10.0 - 2007-01-05
 

+ 2 - 0
src/java/org/apache/hadoop/dfs/ClientProtocol.java

@@ -206,6 +206,7 @@ interface ClientProtocol extends VersionedProtocol {
      * Locking is a part of most filesystems and is useful for a
      * number of inter-process synchronization tasks.
      */
+    /** @deprecated */ @Deprecated
     public boolean obtainLock(String src, String clientName, boolean exclusive) throws IOException;
 
     /**
@@ -213,6 +214,7 @@ interface ClientProtocol extends VersionedProtocol {
      * a held lock.  It returns true if the lock is correctly released.
      * It returns false if the client should wait and try again.
      */
+    /** @deprecated */ @Deprecated
     public boolean releaseLock(String src, String clientName) throws IOException;
 
     /**

+ 2 - 0
src/java/org/apache/hadoop/dfs/DistributedFileSystem.java

@@ -202,10 +202,12 @@ public class DistributedFileSystem extends FileSystem {
         return dfs.mkdirs(getPath(f));
     }
 
+    /** @deprecated */ @Deprecated
     public void lock(Path f, boolean shared) throws IOException {
         dfs.lock(getPath(f), ! shared);
     }
 
+    /** @deprecated */ @Deprecated
     public void release(Path f) throws IOException {
         dfs.release(getPath(f));
     }

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

@@ -1286,6 +1286,7 @@ class FSNamesystem implements FSConstants {
     /**
      * Get a lock (perhaps exclusive) on the given file
      */
+    /** @deprecated */ @Deprecated
     public synchronized int obtainLock( UTF8 src, 
                                         UTF8 holder, 
                                         boolean exclusive) throws IOException {
@@ -1313,6 +1314,7 @@ class FSNamesystem implements FSConstants {
     /**
      * Release the lock on the given file
      */
+    /** @deprecated */ @Deprecated
     public synchronized int releaseLock(UTF8 src, UTF8 holder) {
         int result = internalReleaseLock(src, holder);
         if (result == COMPLETE_SUCCESS) {

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

@@ -400,8 +400,7 @@ public class NameNode implements ClientProtocol, DatanodeProtocol, FSConstants {
         return namesystem.mkdirs( src );
     }
 
-    /**
-     */
+    /** @deprecated */ @Deprecated
     public boolean obtainLock(String src, String clientName, boolean exclusive) throws IOException {
         int returnCode = namesystem.obtainLock(new UTF8(src), new UTF8(clientName), exclusive);
         if (returnCode == COMPLETE_SUCCESS) {
@@ -413,8 +412,7 @@ public class NameNode implements ClientProtocol, DatanodeProtocol, FSConstants {
         }
     }
 
-    /**
-     */
+    /** @deprecated */ @Deprecated
     public boolean releaseLock(String src, String clientName) throws IOException {
         int returnCode = namesystem.releaseLock(new UTF8(src), new UTF8(clientName));
         if (returnCode == COMPLETE_SUCCESS) {

+ 6 - 0
src/java/org/apache/hadoop/fs/FileSystem.java

@@ -815,12 +815,18 @@ public abstract class FileSystem extends Configured {
 
     /**
      * Obtain a lock on the given Path
+     * 
+     * @deprecated FS does not support file locks anymore.
      */
+    @Deprecated
     public abstract void lock(Path f, boolean shared) throws IOException;
 
     /**
      * Release the lock
+     * 
+     * @deprecated FS does not support file locks anymore.     
      */
+    @Deprecated
     public abstract void release(Path f) throws IOException;
 
     /**

+ 2 - 0
src/java/org/apache/hadoop/fs/LocalFileSystem.java

@@ -279,6 +279,7 @@ public class LocalFileSystem extends FileSystem {
       return workingDir;
     }
     
+    /** @deprecated */ @Deprecated
     public void lock(Path p, boolean shared) throws IOException {
       File f = pathToFile(p);
       f.createNewFile();
@@ -301,6 +302,7 @@ public class LocalFileSystem extends FileSystem {
       }
     }
 
+    /** @deprecated */ @Deprecated
     public void release(Path p) throws IOException {
       File f = pathToFile(p);
 

+ 2 - 0
src/java/org/apache/hadoop/fs/s3/S3FileSystem.java

@@ -311,11 +311,13 @@ public class S3FileSystem extends FileSystem {
     return new String[][] { { "localhost" } };
   }
 
+  /** @deprecated */ @Deprecated
   @Override
   public void lock(Path path, boolean shared) throws IOException {
     // TODO: Design and implement
   }
 
+  /** @deprecated */ @Deprecated
   @Override
   public void release(Path path) throws IOException {
     // TODO: Design and implement

+ 2 - 0
src/java/org/apache/hadoop/mapred/PhasedFileSystem.java

@@ -338,6 +338,7 @@ public class PhasedFileSystem extends FileSystem {
     return baseFS.mkdirs(f) ;
   }
 
+  /** @deprecated */ @Deprecated
   @Override
   public void lock(
       Path f, boolean shared)
@@ -345,6 +346,7 @@ public class PhasedFileSystem extends FileSystem {
     throw new UnsupportedOperationException("Operation not supported");  
   }
 
+  /** @deprecated */ @Deprecated
   @Override
   public void release(
       Path f)