HDFS-6070. Cleanup use of ReadStatistics in DFSInputStream.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1576047 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Wang 2014-03-10 19:04:05 +00:00
parent a06b21cf67
commit daaa8f03f4
2 changed files with 5 additions and 6 deletions

View File

@ -542,6 +542,8 @@ Release 2.4.0 - UNRELEASED
HDFS-5986. Capture the number of blocks pending deletion on namenode webUI.
(cnauroth)
HDFS-6070. Cleanup use of ReadStatistics in DFSInputStream. (wang)
OPTIMIZATIONS
HDFS-5790. LeaseManager.findPath is very slow when many leases need recovery

View File

@ -659,14 +659,11 @@ implements ByteBufferReadable, CanSetDropBehind, CanSetReadahead,
int nRead, BlockReader blockReader) {
if (nRead <= 0) return;
if (blockReader.isShortCircuit()) {
readStatistics.totalBytesRead += nRead;
readStatistics.totalLocalBytesRead += nRead;
readStatistics.totalShortCircuitBytesRead += nRead;
readStatistics.addShortCircuitBytes(nRead);
} else if (blockReader.isLocal()) {
readStatistics.totalBytesRead += nRead;
readStatistics.totalLocalBytesRead += nRead;
readStatistics.addLocalBytes(nRead);
} else {
readStatistics.totalBytesRead += nRead;
readStatistics.addRemoteBytes(nRead);
}
}