Skip to content

Commit

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

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

* Revert 0aff5a3 (#33593)

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

* Remove unnecessary mocking (#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.
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.