hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject hadoop git commit: HDFS-11592. Closing a file has a wasteful preconditions in NameNode. Contributed by Eric Badger
Date Thu, 30 Mar 2017 22:47:25 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 a351a30d9 -> 14e5a8ed2


HDFS-11592. Closing a file has a wasteful preconditions in NameNode. Contributed by Eric Badger

(cherry picked from commit e5f0622a6f40706d360d45200c8f259c79046438)


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

Branch: refs/heads/branch-2.8
Commit: 14e5a8ed28cd82ff75ac380ebce88b3593c13031
Parents: a351a30
Author: Mingliang Liu <liuml07@apache.org>
Authored: Thu Mar 30 15:44:06 2017 -0700
Committer: Mingliang Liu <liuml07@apache.org>
Committed: Thu Mar 30 15:47:21 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hdfs/server/namenode/INodeFile.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/14e5a8ed/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
index b0663d3..8a5fd68 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeFile.java
@@ -215,9 +215,11 @@ public class INodeFile extends INodeWithAdditionalFields
     for (int i = 0; i < blocks.length; i++) {
       final String err = checkBlockComplete(blocks, i, numCommittedAllowed,
           minReplication);
-      Preconditions.checkState(err == null,
-          "Unexpected block state: %s, file=%s (%s), blocks=%s (i=%s)",
-          err, this, getClass().getSimpleName(), Arrays.asList(blocks), i);
+      if(err != null) {
+        throw new IllegalStateException(String.format("Unexpected block state: " +
+            "%s, file=%s (%s), blocks=%s (i=%s)", err, this,
+            getClass().getSimpleName(), Arrays.asList(blocks), i));
+      }
     }
   }
 


---------------------------------------------------------------------
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