estimator#afterLoad should be invoked once only per reader.

It was being invoked once per reader and parent type combination resulting in more memory being reported to the circuit breaker than actually being used in field data.
This commit is contained in:
Martijn van Groningen 2014-02-27 13:26:54 +01:00
parent aacc169007
commit d167a0139a
1 changed files with 3 additions and 3 deletions

View File

@ -136,13 +136,13 @@ public class ParentChildIndexFieldData extends AbstractIndexFieldData<ParentChil
} finally { } finally {
for (ObjectObjectCursor<String, TypeBuilder> cursor : typeBuilders) { for (ObjectObjectCursor<String, TypeBuilder> cursor : typeBuilders) {
cursor.value.builder.close(); cursor.value.builder.close();
}
if (success) { if (success) {
estimator.afterLoad(null, data.getMemorySizeInBytes()); estimator.afterLoad(null, data.getMemorySizeInBytes());
} }
} }
} }
} }
}
@Override @Override
public void beforeCreate(DocumentMapper mapper) { public void beforeCreate(DocumentMapper mapper) {