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 25, 2018
1 parent c0c6a28 commit 70871b5
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 70871b5

Please sign in to comment.