Skip to content

Commit 5f170cb

Browse files
committed
Remove Index Reader warmer introduced in 0.90.6
It create the following challenges: - it automatically load all the norms for all fields. This should be an opt in feature similar to the new loading feature in field data. Will open a separate issue for it. - It automatically loads all doc values for all fields (if they have it), overriding effectively the loading option of field data when its backed by doc values. closes elastic#4078
1 parent 356de95 commit 5f170cb

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/main/java/org/elasticsearch/search/SearchService.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@
2121

2222
import com.google.common.collect.ImmutableMap;
2323
import org.apache.lucene.index.AtomicReaderContext;
24-
import org.apache.lucene.index.SimpleMergedSegmentWarmer;
2524
import org.apache.lucene.search.TopDocs;
26-
import org.apache.lucene.util.InfoStream;
2725
import org.elasticsearch.ElasticSearchException;
28-
import org.elasticsearch.ElasticSearchIllegalStateException;
2926
import org.elasticsearch.ExceptionsHelper;
3027
import org.elasticsearch.action.search.SearchType;
3128
import org.elasticsearch.cache.recycler.CacheRecycler;
@@ -137,7 +134,6 @@ public SearchService(Settings settings, ClusterService clusterService, IndicesSe
137134

138135
this.keepAliveReaper = threadPool.scheduleWithFixedDelay(new Reaper(), keepAliveInterval);
139136

140-
this.indicesWarmer.addListener(new IndexReaderWarmer());
141137
this.indicesWarmer.addListener(new FieldDataWarmer());
142138
this.indicesWarmer.addListener(new SearchWarmer());
143139
}
@@ -632,27 +628,6 @@ private void processScroll(InternalScrollSearchRequest request, SearchContext co
632628
}
633629
}
634630

635-
static class IndexReaderWarmer extends IndicesWarmer.Listener {
636-
637-
private final SimpleMergedSegmentWarmer warmer = new SimpleMergedSegmentWarmer(InfoStream.NO_OUTPUT);
638-
639-
@Override
640-
public void warm(IndexShard indexShard, IndexMetaData indexMetaData, WarmerContext context, ThreadPool threadPool) {
641-
long start = System.nanoTime();
642-
try {
643-
for (AtomicReaderContext ctx : context.newSearcher().reader().leaves()) {
644-
warmer.warm(ctx.reader());
645-
}
646-
if (indexShard.warmerService().logger().isTraceEnabled()) {
647-
indexShard.warmerService().logger().trace("warmed readers, took [{}]", TimeValue.timeValueNanos(System.nanoTime() - start));
648-
}
649-
} catch (Throwable t) {
650-
throw new ElasticSearchIllegalStateException("Unexpected exception while warming-up segment", t);
651-
}
652-
}
653-
654-
}
655-
656631
static class FieldDataWarmer extends IndicesWarmer.Listener {
657632

658633
@Override

0 commit comments

Comments
 (0)