|
@@ -3559,6 +3559,7 @@ public abstract class FileSystem extends Configured
|
|
private volatile long bytesReadDistanceOfOneOrTwo;
|
|
private volatile long bytesReadDistanceOfOneOrTwo;
|
|
private volatile long bytesReadDistanceOfThreeOrFour;
|
|
private volatile long bytesReadDistanceOfThreeOrFour;
|
|
private volatile long bytesReadDistanceOfFiveOrLarger;
|
|
private volatile long bytesReadDistanceOfFiveOrLarger;
|
|
|
|
+ private volatile long bytesReadErasureCoded;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Add another StatisticsData object to this one.
|
|
* Add another StatisticsData object to this one.
|
|
@@ -3575,6 +3576,7 @@ public abstract class FileSystem extends Configured
|
|
other.bytesReadDistanceOfThreeOrFour;
|
|
other.bytesReadDistanceOfThreeOrFour;
|
|
this.bytesReadDistanceOfFiveOrLarger +=
|
|
this.bytesReadDistanceOfFiveOrLarger +=
|
|
other.bytesReadDistanceOfFiveOrLarger;
|
|
other.bytesReadDistanceOfFiveOrLarger;
|
|
|
|
+ this.bytesReadErasureCoded += other.bytesReadErasureCoded;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -3592,6 +3594,7 @@ public abstract class FileSystem extends Configured
|
|
-this.bytesReadDistanceOfThreeOrFour;
|
|
-this.bytesReadDistanceOfThreeOrFour;
|
|
this.bytesReadDistanceOfFiveOrLarger =
|
|
this.bytesReadDistanceOfFiveOrLarger =
|
|
-this.bytesReadDistanceOfFiveOrLarger;
|
|
-this.bytesReadDistanceOfFiveOrLarger;
|
|
|
|
+ this.bytesReadErasureCoded = -this.bytesReadErasureCoded;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -3636,6 +3639,10 @@ public abstract class FileSystem extends Configured
|
|
public long getBytesReadDistanceOfFiveOrLarger() {
|
|
public long getBytesReadDistanceOfFiveOrLarger() {
|
|
return bytesReadDistanceOfFiveOrLarger;
|
|
return bytesReadDistanceOfFiveOrLarger;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public long getBytesReadErasureCoded() {
|
|
|
|
+ return bytesReadErasureCoded;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private interface StatisticsAggregator<T> {
|
|
private interface StatisticsAggregator<T> {
|
|
@@ -3827,6 +3834,14 @@ public abstract class FileSystem extends Configured
|
|
getThreadStatistics().writeOps += count;
|
|
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
|
|
* Increment the bytes read by the network distance in the statistics
|
|
* In the common network topology setup, distance value should be an even
|
|
* In the common network topology setup, distance value should be an even
|
|
@@ -4021,6 +4036,25 @@ public abstract class FileSystem extends Configured
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 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
|
|
@Override
|
|
public String toString() {
|
|
public String toString() {
|
|
return visitAll(new StatisticsAggregator<String>() {
|
|
return visitAll(new StatisticsAggregator<String>() {
|