Forráskód Böngészése

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 #4078

Shay Banon 12 éve
szülő
commit
5f170cb4fd

+ 0 - 25
src/main/java/org/elasticsearch/search/SearchService.java

@@ -21,11 +21,8 @@ package org.elasticsearch.search;
 
 import com.google.common.collect.ImmutableMap;
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.SimpleMergedSegmentWarmer;
 import org.apache.lucene.search.TopDocs;
-import org.apache.lucene.util.InfoStream;
 import org.elasticsearch.ElasticSearchException;
-import org.elasticsearch.ElasticSearchIllegalStateException;
 import org.elasticsearch.ExceptionsHelper;
 import org.elasticsearch.action.search.SearchType;
 import org.elasticsearch.cache.recycler.CacheRecycler;
@@ -137,7 +134,6 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
 
         this.keepAliveReaper = threadPool.scheduleWithFixedDelay(new Reaper(), keepAliveInterval);
 
-        this.indicesWarmer.addListener(new IndexReaderWarmer());
         this.indicesWarmer.addListener(new FieldDataWarmer());
         this.indicesWarmer.addListener(new SearchWarmer());
     }
@@ -632,27 +628,6 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
         }
     }
 
-    static class IndexReaderWarmer extends IndicesWarmer.Listener {
-
-        private final SimpleMergedSegmentWarmer warmer = new SimpleMergedSegmentWarmer(InfoStream.NO_OUTPUT);
-
-        @Override
-        public void warm(IndexShard indexShard, IndexMetaData indexMetaData, WarmerContext context, ThreadPool threadPool) {
-            long start = System.nanoTime();
-            try {
-                for (AtomicReaderContext ctx : context.newSearcher().reader().leaves()) {
-                    warmer.warm(ctx.reader());
-                }
-                if (indexShard.warmerService().logger().isTraceEnabled()) {
-                    indexShard.warmerService().logger().trace("warmed readers, took [{}]", TimeValue.timeValueNanos(System.nanoTime() - start));
-                }
-            } catch (Throwable t) {
-                throw new ElasticSearchIllegalStateException("Unexpected exception while warming-up segment", t);
-            }
-        }
-
-    }
-
     static class FieldDataWarmer extends IndicesWarmer.Listener {
 
         @Override