Is there a way to test to if debug is enabled before invoking a
statement like :
NameNode.stateChangeLog.debug(
"BLOCK* NameSystem.UnderReplicationBlock.add:"
+ block.getBlockName()
+ " has only "+curReplicas
+ " replicas and need " + expectedReplicas
+ " replicas so is added to neededReplications"
+ " at priority level " + priLevel );
It looks like we pay the cost of constructing the string for this call
all the time. This seems to involve multiple allocations and
deallocations, int to string conversions, and string concatenations etc.
Since there are multiple such statements in various critical code paths
on namenode, it could affect quite a bit of performance. Should we have
something like :
if ( debugEnabled ) {
NameNode.stateChangeLog.debug( ...
}
Raghu.