Fix 13202
This commit is contained in:
parent
aa26b66e96
commit
38805f3cbd
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue