private void updateReplicationMetrics ( List < ReplicationWork > work ) { for ( ReplicationWork rw : work ) { DatanodeDescriptor [ ] targets = rw . targets ; if ( targets == null ) continue ; for ( DatanodeDescriptor target : targets ) { if ( clusterMap . isOnSameRack ( rw . srcNode , target ) ) { myFSMetrics . numLocalRackReplications . inc ( ) ; } else { myFSMetrics . numAcrossRackReplications . inc ( ) ; } } } }
Update replication metrics