Github user kkhatua commented on a diff in the pull request:
https://github.com/apache/drill/pull/1141#discussion_r171740245
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentStats.java ---
@@ -79,4 +71,21 @@ public void addOperatorStats(OperatorStats stats) {
operators.add(stats);
}
+ //DRILL-6197
+ public OperatorStats addOrReplaceOperatorStats(OperatorStats stats) {
+ //Remove existing stat
+ OperatorStats replacedStat = null;
+ int index = 0;
+ for (OperatorStats opStat : operators) {
--- End diff --
I see your point. Also, digging into the code shows I can substitute with a
LinkedHashMap, since the list is only referenced here for consumption of its
contents:
https://github.com/kkhatua/drill/blob/65efe3ea0c5777490488d3d56cbdb0cb011b9f33/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentStats.java#L45
I can't use a Set, because I need the Stats object hashed on the operator
ID & Type, and not the rest of the contents. I'll refactor and try to confirm
nothing else breaks.
---