strict listeners

This commit is contained in:
Ivannikov Kirill 2015-09-02 17:59:41 +05:00
parent fd8476dbd7
commit a097375a6f
1 changed files with 3 additions and 16 deletions

View File

@ -131,23 +131,14 @@ public class ShardIndexingService extends AbstractIndexShardComponent {
totalStats.indexCurrent.inc(); totalStats.indexCurrent.inc();
typeStats(index.type()).indexCurrent.inc(); typeStats(index.type()).indexCurrent.inc();
for (IndexingOperationListener listener : listeners) { for (IndexingOperationListener listener : listeners) {
try {
listener.preIndex(index); listener.preIndex(index);
} catch (Exception e) {
logger.warn("preIndex listener [{}] failed", e, listener);
}
} }
return index; return index;
} }
public void postIndexUnderLock(Engine.Index index) { public void postIndexUnderLock(Engine.Index index) {
for (IndexingOperationListener listener : listeners) { for (IndexingOperationListener listener : listeners) {
try {
listener.postIndexUnderLock(index); listener.postIndexUnderLock(index);
} catch (Exception e) {
logger.warn("postIndexUnderLock listener [{}] failed", e, listener);
}
} }
} }
@ -160,11 +151,7 @@ public class ShardIndexingService extends AbstractIndexShardComponent {
typeStats.indexCurrent.dec(); typeStats.indexCurrent.dec();
slowLog.postIndex(index, took); slowLog.postIndex(index, took);
for (IndexingOperationListener listener : listeners) { for (IndexingOperationListener listener : listeners) {
try {
listener.postIndex(index); listener.postIndex(index);
} catch (Exception e) {
logger.warn("postIndex listener [{}] failed", e, listener);
}
} }
} }