hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [33/50] [abbrv] hadoop git commit: HDFS-10773. BlockSender should not synchronize on the dataset object. (Contributed by Chen Liang)
Date Fri, 19 Aug 2016 20:33:48 GMT
HDFS-10773. BlockSender should not synchronize on the dataset object. (Contributed by Chen
Liang)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ca13e797
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ca13e797
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ca13e797

Branch: refs/heads/HDFS-7240
Commit: ca13e7971d0db0705d5e36bcf03ead3cab5ab0d7
Parents: 2aa5e2c
Author: Arpit Agarwal <arp@apache.org>
Authored: Wed Aug 17 16:29:08 2016 -0700
Committer: Arpit Agarwal <arp@apache.org>
Committed: Wed Aug 17 16:29:08 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ca13e797/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
index 398935d..7c3d778 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockSender.java
@@ -46,6 +46,7 @@ import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.ReadaheadPool.ReadaheadRequest;
 import org.apache.hadoop.io.nativeio.NativeIO;
 import org.apache.hadoop.net.SocketOutputStream;
+import org.apache.hadoop.util.AutoCloseableLock;
 import org.apache.hadoop.util.DataChecksum;
 import org.apache.htrace.core.TraceScope;
 
@@ -239,7 +240,7 @@ class BlockSender implements java.io.Closeable {
       
       final Replica replica;
       final long replicaVisibleLength;
-      synchronized(datanode.data) { 
+      try(AutoCloseableLock lock = datanode.data.acquireDatasetLock()) {
         replica = getReplica(block, datanode);
         replicaVisibleLength = replica.getVisibleLength();
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message