Example usage for org.apache.hadoop.hdfs BlockReader isShortCircuit

List of usage examples for org.apache.hadoop.hdfs BlockReader isShortCircuit

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs BlockReader isShortCircuit.

Prototype

boolean isShortCircuit();

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;// w ww  .j a  va2  s  . c  om
    synchronized (infoLock) {
        if (blockReader.isShortCircuit()) {
            readStatistics.addShortCircuitBytes(nRead);
        } else if (blockReader.isLocal()) {
            readStatistics.addLocalBytes(nRead);
        } else {
            readStatistics.addRemoteBytes(nRead);
        }
    }
}