Refactor TableScanOperator stats collection
Reorganizes TableScanOperator stats collection to match the changes
made to ScanFilterAndProjectOperator.
@@ -254,14 +254,8 @@ public class TableScanOperator
page = page.getLoadedPage();
// update operator stats
- long endCompletedBytes = source.getCompletedBytes();
- long endCompletedPositions = source.getCompletedPositions();
- long endReadTimeNanos = source.getReadTimeNanos();
- operatorContext.recordRawInputWithTiming(endCompletedBytes - completedBytes, endCompletedPositions - completedPositions, endReadTimeNanos - readTimeNanos);
operatorContext.recordProcessedInput(page.getSizeInBytes(), page.getPositionCount());
- completedBytes = endCompletedBytes;
- completedPositions = endCompletedPositions;
- readTimeNanos = endReadTimeNanos;
+ recordSourceRawInputStats();
}
// updating system memory usage should happen after page is loaded.
@@ -269,4 +263,17 @@ public class TableScanOperator
return page;
}
+
+ private void recordSourceRawInputStats()
+ {
+ checkState(source != null, "source must not be null");
+ // update operator stats
+ long endCompletedBytes = source.getCompletedBytes();
+ long endCompletedPositions = source.getCompletedPositions();
+ long endReadTimeNanos = source.getReadTimeNanos();
+ operatorContext.recordRawInputWithTiming(endCompletedBytes - completedBytes, endCompletedPositions - completedPositions, endReadTimeNanos - readTimeNanos);
+ completedBytes = endCompletedBytes;
+ completedPositions = endCompletedPositions;
+ readTimeNanos = endReadTimeNanos;
+ }
}
