Skip to content

Commit

Permalink
Check self references in metric agg after last doc collection (elasti…
Browse files Browse the repository at this point in the history
…c#33593)

(elastic#34001)

* Check self references in metric agg after last doc collection (elastic#33593)

* Revert 0aff5a3 (elastic#33593)

* Check self refs in metric agg only once in post collection hook
(elastic#33593)

* Remove unnecessary mocking (elastic#33593)
  • Loading branch information
cbismuth authored and colings86 committed Oct 26, 2018
1 parent d9b49bd commit 464e4ab
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public void collect(int doc, long bucket) throws IOException {

leafMapScript.setDocument(doc);
leafMapScript.execute();
CollectionUtils.ensureNoSelfReferences(aggState);
}
};
}
Expand All @@ -98,4 +97,10 @@ public InternalAggregation buildEmptyAggregation() {
return new InternalScriptedMetric(name, null, reduceScript, pipelineAggregators(), metaData());
}

@Override
protected void doPostCollection() throws IOException {
CollectionUtils.ensureNoSelfReferences(aggState);

super.doPostCollection();
}
}

0 comments on commit 464e4ab

Please sign in to comment.