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 kcm committed Oct 30, 2018
1 parent 48609ab commit 7f01236
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public void collect(int doc, long bucket) throws IOException {

leafMapScript.setDocument(doc);
leafMapScript.execute();
CollectionUtils.ensureNoSelfReferences(aggState, "Scripted metric aggs map script");
}
};
}
Expand All @@ -103,4 +102,10 @@ public InternalAggregation buildEmptyAggregation() {
return new InternalScriptedMetric(name, null, reduceScript, pipelineAggregators(), metaData());
}

@Override
protected void doPostCollection() throws IOException {
CollectionUtils.ensureNoSelfReferences(aggState, "Scripted metric aggs map script");

super.doPostCollection();
}
}

0 comments on commit 7f01236

Please sign in to comment.