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

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

Introduction

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

Prototype

public synchronized long getTotalBytesRead() 

Source Link

Usage

From source file:com.cloudera.ByteBufferRecordReader.java

License:Apache License

private void updateStats(ReadStatistics newStats) {
    context.getCounter(READ_COUNTER.BYTES_READ)
            .increment(newStats.getTotalBytesRead() - readStats.getTotalBytesRead());
    context.getCounter(READ_COUNTER.LOCAL_BYTES_READ)
            .increment(newStats.getTotalLocalBytesRead() - readStats.getTotalLocalBytesRead());
    context.getCounter(READ_COUNTER.SCR_BYTES_READ)
            .increment(newStats.getTotalShortCircuitBytesRead() - readStats.getTotalShortCircuitBytesRead());
    context.getCounter(READ_COUNTER.ZCR_BYTES_READ)
            .increment(newStats.getTotalZeroCopyBytesRead() - readStats.getTotalZeroCopyBytesRead());

    this.readStats = new ReadStatistics(newStats);
}