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

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

* Revert 0aff5a30c5dbad9f476be14f34b81e2d1991bb0f (#33593)

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

* Remove unnecessary mocking (#33593)
This commit is contained in:
Christophe Bismuth 2018-10-25 18:12:50 +02:00 committed by Colin Goodheart-Smithe
parent c0c6a28e86
commit 70871b5af7
1 changed files with 6 additions and 1 deletions

View File

@ -80,7 +80,6 @@ class ScriptedMetricAggregator extends MetricsAggregator {
leafMapScript.setDocument(doc);
leafMapScript.execute();
CollectionUtils.ensureNoSelfReferences(aggState, "Scripted metric aggs map script");
}
};
}
@ -103,4 +102,10 @@ class ScriptedMetricAggregator extends MetricsAggregator {
return new InternalScriptedMetric(name, null, reduceScript, pipelineAggregators(), metaData());
}
@Override
protected void doPostCollection() throws IOException {
CollectionUtils.ensureNoSelfReferences(aggState, "Scripted metric aggs map script");
super.doPostCollection();
}
}