소스 검색

HADOOP-1517. Remove some synchronization from namenode to permit finer grained locking previously added. Contributed by Konstantin.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@549624 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 년 전
부모
커밋
e5e5a270c3
2개의 변경된 파일14개의 추가작업 그리고 11개의 파일을 삭제
  1. 3 0
      CHANGES.txt
  2. 11 11
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -233,6 +233,9 @@ Trunk (unreleased changes)
 
  71. HADOOP-1511.  Speedup hbase unit tests.  (stack via cutting)
 
+ 72. HADOOP-1517.  Remove some synchronization in namenode to permit
+     finer grained locking previously added.  (Konstantin Shvachko via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

+ 11 - 11
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -596,13 +596,13 @@ class FSNamesystem implements FSConstants {
    * @throws IOException if the filename is invalid
    *         {@link FSDirectory#isValidToCreate(String)}.
    */
-  public synchronized LocatedBlock startFile(String src, 
-                                             String holder, 
-                                             String clientMachine, 
-                                             boolean overwrite,
-                                             short replication,
-                                             long blockSize
-                                             ) throws IOException {
+  public LocatedBlock startFile(String src, 
+                                String holder, 
+                                String clientMachine, 
+                                boolean overwrite,
+                                short replication,
+                                long blockSize
+                                ) throws IOException {
 
     //
     // Create file into pendingCreates and get the first blockId
@@ -769,9 +769,9 @@ class FSNamesystem implements FSConstants {
    * are replicated.  Will return an empty 2-elt array if we want the
    * client to "try again later".
    */
-  public synchronized LocatedBlock getAdditionalBlock(String src, 
-                                                      String clientName
-                                                      ) throws IOException {
+  public LocatedBlock getAdditionalBlock(String src, 
+                                         String clientName
+                                         ) throws IOException {
     long fileLength, blockSize;
     int replication;
     DatanodeDescriptor clientNode = null;
@@ -973,7 +973,7 @@ class FSNamesystem implements FSConstants {
   /**
    * Allocate a block at the given pending filename
    */
-  synchronized Block allocateBlock(String src) throws IOException {
+  private Block allocateBlock(String src) throws IOException {
     Block b = null;
     do {
       b = new Block(FSNamesystem.randBlockId.nextLong(), 0);