mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-20 03:45:02 +00:00
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
This commit is contained in:
parent
356de95840
commit
5f170cb4fd
@ -21,11 +21,8 @@ package org.elasticsearch.search;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import org.apache.lucene.index.AtomicReaderContext;
|
import org.apache.lucene.index.AtomicReaderContext;
|
||||||
import org.apache.lucene.index.SimpleMergedSegmentWarmer;
|
|
||||||
import org.apache.lucene.search.TopDocs;
|
import org.apache.lucene.search.TopDocs;
|
||||||
import org.apache.lucene.util.InfoStream;
|
|
||||||
import org.elasticsearch.ElasticSearchException;
|
import org.elasticsearch.ElasticSearchException;
|
||||||
import org.elasticsearch.ElasticSearchIllegalStateException;
|
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.action.search.SearchType;
|
import org.elasticsearch.action.search.SearchType;
|
||||||
import org.elasticsearch.cache.recycler.CacheRecycler;
|
import org.elasticsearch.cache.recycler.CacheRecycler;
|
||||||
@ -137,7 +134,6 @@ public class SearchService extends AbstractLifecycleComponent<SearchService> {
|
|||||||
|
|
||||||
this.keepAliveReaper = threadPool.scheduleWithFixedDelay(new Reaper(), keepAliveInterval);
|
this.keepAliveReaper = threadPool.scheduleWithFixedDelay(new Reaper(), keepAliveInterval);
|
||||||
|
|
||||||
this.indicesWarmer.addListener(new IndexReaderWarmer());
|
|
||||||
this.indicesWarmer.addListener(new FieldDataWarmer());
|
this.indicesWarmer.addListener(new FieldDataWarmer());
|
||||||
this.indicesWarmer.addListener(new SearchWarmer());
|
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 {
|
static class FieldDataWarmer extends IndicesWarmer.Listener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user