HDFS-11592. Closing a file has a wasteful preconditions in NameNode. Contributed by Eric Badger
This commit is contained in:
parent
b58777a9c9
commit
e5f0622a6f
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user