Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 25, 2018
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();
}
}