From 7b10ef0c3bfec9cdf20d6e2385b6d218809a37b9 Mon Sep 17 00:00:00 2001 From: yliu Date: Fri, 6 Feb 2015 06:31:03 +0800 Subject: [PATCH] HDFS-7741. Remove unnecessary synchronized in FSDataInputStream and HdfsDataInputStream. (yliu) --- .../src/main/java/org/apache/hadoop/fs/FSDataInputStream.java | 2 +- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/client/HdfsDataInputStream.java | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java index c8609d450f2..6d39d1e0b89 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FSDataInputStream.java @@ -58,7 +58,7 @@ public class FSDataInputStream extends DataInputStream * @param desired offset to seek to */ @Override - public synchronized void seek(long desired) throws IOException { + public void seek(long desired) throws IOException { ((Seekable)in).seek(desired); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 756b70fc182..78aa992fbee 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -851,6 +851,9 @@ Release 2.7.0 - UNRELEASED HDFS-7698. Fix locking on HDFS read statistics and add a method for clearing them. (Colin P. McCabe via yliu) + HDFS-7741. Remove unnecessary synchronized in FSDataInputStream and + HdfsDataInputStream. (yliu) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsDataInputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsDataInputStream.java index 72c57a860bc..e8ac6865e43 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsDataInputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/client/HdfsDataInputStream.java @@ -83,7 +83,7 @@ public class HdfsDataInputStream extends FSDataInputStream { /** * Get the collection of blocks that has already been located. */ - public synchronized List getAllBlocks() throws IOException { + public List getAllBlocks() throws IOException { return getDFSInputStream().getAllBlocks(); }