Преглед на файлове

HDFS-7741. Remove unnecessary synchronized in FSDataInputStream and HdfsDataInputStream. (yliu)

yliu преди 10 години
родител
ревизия
e2803f5a51

+ 1 - 1
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);
   }
 

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -569,6 +569,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

+ 1 - 1
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<LocatedBlock> getAllBlocks() throws IOException {
+  public List<LocatedBlock> getAllBlocks() throws IOException {
     return getDFSInputStream().getAllBlocks();
   }