|
@@ -3605,6 +3605,7 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
private volatile long bytesReadDistanceOfOneOrTwo;
|
|
|
private volatile long bytesReadDistanceOfThreeOrFour;
|
|
|
private volatile long bytesReadDistanceOfFiveOrLarger;
|
|
|
+ private volatile long bytesReadErasureCoded;
|
|
|
|
|
|
/**
|
|
|
* Add another StatisticsData object to this one.
|
|
@@ -3621,6 +3622,7 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
other.bytesReadDistanceOfThreeOrFour;
|
|
|
this.bytesReadDistanceOfFiveOrLarger +=
|
|
|
other.bytesReadDistanceOfFiveOrLarger;
|
|
|
+ this.bytesReadErasureCoded += other.bytesReadErasureCoded;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3638,6 +3640,7 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
-this.bytesReadDistanceOfThreeOrFour;
|
|
|
this.bytesReadDistanceOfFiveOrLarger =
|
|
|
-this.bytesReadDistanceOfFiveOrLarger;
|
|
|
+ this.bytesReadErasureCoded = -this.bytesReadErasureCoded;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -3682,6 +3685,10 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
public long getBytesReadDistanceOfFiveOrLarger() {
|
|
|
return bytesReadDistanceOfFiveOrLarger;
|
|
|
}
|
|
|
+
|
|
|
+ public long getBytesReadErasureCoded() {
|
|
|
+ return bytesReadErasureCoded;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private interface StatisticsAggregator<T> {
|
|
@@ -3873,6 +3880,14 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
getThreadStatistics().writeOps += count;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Increment the bytes read on erasure-coded files in the statistics.
|
|
|
+ * @param newBytes the additional bytes read
|
|
|
+ */
|
|
|
+ public void incrementBytesReadErasureCoded(long newBytes) {
|
|
|
+ getThreadStatistics().bytesReadErasureCoded += newBytes;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Increment the bytes read by the network distance in the statistics
|
|
|
* In the common network topology setup, distance value should be an even
|
|
@@ -4067,6 +4082,25 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get the total number of bytes read on erasure-coded files.
|
|
|
+ * @return the number of bytes
|
|
|
+ */
|
|
|
+ public long getBytesReadErasureCoded() {
|
|
|
+ return visitAll(new StatisticsAggregator<Long>() {
|
|
|
+ private long bytesReadErasureCoded = 0;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void accept(StatisticsData data) {
|
|
|
+ bytesReadErasureCoded += data.bytesReadErasureCoded;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long aggregate() {
|
|
|
+ return bytesReadErasureCoded;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public String toString() {
|
|
|
return visitAll(new StatisticsAggregator<String>() {
|