Revert "HDFS-10620. StringBuilder created and appended even if logging is disabled. Contributed by Staffan Friberg."
This reverts commit 2685e16f381532d53aea413ce1c0a14181ee7c89.
This commit is contained in:
parent
0dde4035c9
commit
a04b193374
@ -1195,19 +1195,16 @@ private void addToInvalidates(Block b) {
|
||||
if (!isPopulatingReplQueues()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder datanodes = blockLog.isDebugEnabled()
|
||||
? new StringBuilder() : null;
|
||||
StringBuilder datanodes = new StringBuilder();
|
||||
for (DatanodeStorageInfo storage : blocksMap.getStorages(b)) {
|
||||
if (storage.getState() != State.NORMAL) {
|
||||
continue;
|
||||
}
|
||||
final DatanodeDescriptor node = storage.getDatanodeDescriptor();
|
||||
invalidateBlocks.add(b, node, false);
|
||||
if (datanodes != null) {
|
||||
datanodes.append(node).append(" ");
|
||||
}
|
||||
datanodes.append(node).append(" ");
|
||||
}
|
||||
if (datanodes != null & datanodes.length() != 0) {
|
||||
if (datanodes.length() != 0) {
|
||||
blockLog.debug("BLOCK* addToInvalidates: {} {}", b, datanodes);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user