HDFS-16530. setReplication debug log creates a new string even if debug is disabled (#4142)

(cherry picked from commit bbfe3500cf)
This commit is contained in:
Stephen O'Donnell 2022-04-06 08:49:52 +01:00 committed by S O'Donnell
parent b2eee14f2e
commit bd0dbf319a

View File

@ -408,7 +408,7 @@ static BlockInfo[] unprotectedSetReplication(
bm.setReplication(oldBR, targetReplication, b);
}
if (oldBR != -1) {
if (oldBR != -1 && FSDirectory.LOG.isDebugEnabled()) {
if (oldBR > targetReplication) {
FSDirectory.LOG.debug("Decreasing replication from {} to {} for {}",
oldBR, targetReplication, iip.getPath());