Fix 13202

This commit is contained in:
Ivannikov Kirill 2015-08-30 23:56:34 +05:00
parent aa26b66e96
commit 38805f3cbd
2 changed files with 14 additions and 0 deletions

View File

@ -73,6 +73,13 @@ public abstract class IndexingOperationListener {
}
/**
* Called after the indexing operation occurred with exception.
*/
public void postIndex(Engine.Index index, Throwable ex) {
}
/**
* Called before the delete occurs.
*/

View File

@ -171,6 +171,13 @@ public class ShardIndexingService extends AbstractIndexShardComponent {
public void postIndex(Engine.Index index, Throwable ex) {
totalStats.indexCurrent.dec();
typeStats(index.type()).indexCurrent.dec();
for (IndexingOperationListener listener : listeners) {
try {
listener.postIndex(index, ex);
} catch (Exception e) {
logger.warn("post listener [{}] failed", e, listener);
}
}
}
public Engine.Delete preDelete(Engine.Delete delete) {