if ttl field mappers don't exists (yet), ignore it for that shard

This commit is contained in:
Shay Banon 2011-09-09 13:31:40 +03:00
parent 100df0dca8
commit 84ae001731
1 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,9 @@ public class IndicesTTLService extends AbstractLifecycleComponent<IndicesTTLServ
for (IndexService indexService : indicesService) { for (IndexService indexService : indicesService) {
// should be optimized with the hasTTL flag // should be optimized with the hasTTL flag
FieldMappers ttlFieldMappers = indexService.mapperService().name(TTLFieldMapper.NAME); FieldMappers ttlFieldMappers = indexService.mapperService().name(TTLFieldMapper.NAME);
if (ttlFieldMappers == null) {
continue;
}
// check if ttl is enabled for at least one type of this index // check if ttl is enabled for at least one type of this index
boolean hasTTLEnabled = false; boolean hasTTLEnabled = false;
for (FieldMapper ttlFieldMapper : ttlFieldMappers) { for (FieldMapper ttlFieldMapper : ttlFieldMappers) {