|
21 | 21 |
|
22 | 22 | import com.google.common.collect.ImmutableMap;
|
23 | 23 | import org.apache.lucene.index.AtomicReaderContext;
|
24 |
| -import org.apache.lucene.index.SimpleMergedSegmentWarmer; |
25 | 24 | import org.apache.lucene.search.TopDocs;
|
26 |
| -import org.apache.lucene.util.InfoStream; |
27 | 25 | import org.elasticsearch.ElasticSearchException;
|
28 |
| -import org.elasticsearch.ElasticSearchIllegalStateException; |
29 | 26 | import org.elasticsearch.ExceptionsHelper;
|
30 | 27 | import org.elasticsearch.action.search.SearchType;
|
31 | 28 | import org.elasticsearch.cache.recycler.CacheRecycler;
|
@@ -137,7 +134,6 @@ public SearchService(Settings settings, ClusterService clusterService, IndicesSe
|
137 | 134 |
|
138 | 135 | this.keepAliveReaper = threadPool.scheduleWithFixedDelay(new Reaper(), keepAliveInterval);
|
139 | 136 |
|
140 |
| - this.indicesWarmer.addListener(new IndexReaderWarmer()); |
141 | 137 | this.indicesWarmer.addListener(new FieldDataWarmer());
|
142 | 138 | this.indicesWarmer.addListener(new SearchWarmer());
|
143 | 139 | }
|
@@ -632,27 +628,6 @@ private void processScroll(InternalScrollSearchRequest request, SearchContext co
|
632 | 628 | }
|
633 | 629 | }
|
634 | 630 |
|
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 |
| - |
656 | 631 | static class FieldDataWarmer extends IndicesWarmer.Listener {
|
657 | 632 |
|
658 | 633 | @Override
|
|
0 commit comments