Example usage for org.apache.hadoop.hdfs ReadStatistics addLocalBytes

List of usage examples for org.apache.hadoop.hdfs ReadStatistics addLocalBytes

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs ReadStatistics addLocalBytes.

Prototype

public synchronized void addLocalBytes(long amt) 

Source Link

Usage

From source file:com.mellanox.r4h.DFSInputStream.java

License:Apache License

private void updateReadStatistics(ReadStatistics readStatistics, int nRead, BlockReader blockReader) {
    if (nRead <= 0)
        return;/*from  w  ww .  ja  v a2s. c o  m*/
    synchronized (infoLock) {
        if (blockReader.isShortCircuit()) {
            readStatistics.addShortCircuitBytes(nRead);
        } else if (blockReader.isLocal()) {
            readStatistics.addLocalBytes(nRead);
        } else {
            readStatistics.addRemoteBytes(nRead);
        }
    }
}