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 2b0e0adea2..3da6aa7c81 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 @@ -328,9 +328,11 @@ private void assertAllBlocksComplete(int numCommittedAllowed, 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)); + } } }