diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java index 2a36a7833cd..e8243bf5d50 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsIndices.java @@ -140,7 +140,7 @@ public class ClusterStatsIndices implements ToXContent, Streamable { docs = DocsStats.readDocStats(in); store = StoreStats.readStoreStats(in); fieldData = FieldDataStats.readFieldDataStats(in); - queryCache = QueryCacheStats.readFilterCacheStats(in); + queryCache = QueryCacheStats.readQueryCacheStats(in); completion = CompletionStats.readCompletionStats(in); segments = SegmentsStats.readSegmentsStats(in); percolate = PercolateStats.readPercolateStats(in); diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java index b2f13b658b9..b2f0deeceff 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java @@ -539,7 +539,7 @@ public class CommonStats implements Streamable, ToXContent { warmer = WarmerStats.readWarmerStats(in); } if (in.readBoolean()) { - queryCache = QueryCacheStats.readFilterCacheStats(in); + queryCache = QueryCacheStats.readQueryCacheStats(in); } if (in.readBoolean()) { fieldData = FieldDataStats.readFieldDataStats(in); diff --git a/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheModule.java b/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheModule.java index 1c9ef9ba157..60288d99130 100644 --- a/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheModule.java +++ b/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheModule.java @@ -31,10 +31,10 @@ import org.elasticsearch.index.cache.query.index.IndexQueryCache; */ public class QueryCacheModule extends AbstractModule { - public static final class FilterCacheSettings { - public static final String FILTER_CACHE_TYPE = "index.queries.cache.type"; + public static final class QueryCacheSettings { + public static final String QUERY_CACHE_TYPE = "index.queries.cache.type"; // for test purposes only - public static final String FILTER_CACHE_EVERYTHING = "index.queries.cache.everything"; + public static final String QUERY_CACHE_EVERYTHING = "index.queries.cache.everything"; } private final Settings settings; @@ -46,12 +46,12 @@ public class QueryCacheModule extends AbstractModule { @Override protected void configure() { bind(QueryCache.class) - .to(settings.getAsClass(FilterCacheSettings.FILTER_CACHE_TYPE, IndexQueryCache.class, "org.elasticsearch.index.cache.query.", "FilterCache")) + .to(settings.getAsClass(QueryCacheSettings.QUERY_CACHE_TYPE, IndexQueryCache.class, "org.elasticsearch.index.cache.query.", "QueryCache")) .in(Scopes.SINGLETON); // the query cache is a node-level thing, however we want the most popular queries // to be computed on a per-index basis, that is why we don't use the SINGLETON // scope below - if (settings.getAsBoolean(FilterCacheSettings.FILTER_CACHE_EVERYTHING, false)) { + if (settings.getAsBoolean(QueryCacheSettings.QUERY_CACHE_EVERYTHING, false)) { bind(QueryCachingPolicy.class).toInstance(QueryCachingPolicy.ALWAYS_CACHE); } else { bind(QueryCachingPolicy.class).toInstance(new UsageTrackingQueryCachingPolicy()); diff --git a/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java b/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java index 7065192747a..aaf2730a31b 100644 --- a/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java +++ b/core/src/main/java/org/elasticsearch/index/cache/query/QueryCacheStats.java @@ -108,7 +108,7 @@ public class QueryCacheStats implements Streamable, ToXContent { return cacheCount - cacheSize; } - public static QueryCacheStats readFilterCacheStats(StreamInput in) throws IOException { + public static QueryCacheStats readQueryCacheStats(StreamInput in) throws IOException { QueryCacheStats stats = new QueryCacheStats(); stats.readFrom(in); return stats; diff --git a/core/src/main/java/org/elasticsearch/index/cache/query/index/IndexQueryCache.java b/core/src/main/java/org/elasticsearch/index/cache/query/index/IndexQueryCache.java index 6a41be5a653..af3d2ea5cb9 100644 --- a/core/src/main/java/org/elasticsearch/index/cache/query/index/IndexQueryCache.java +++ b/core/src/main/java/org/elasticsearch/index/cache/query/index/IndexQueryCache.java @@ -36,12 +36,12 @@ import org.elasticsearch.indices.cache.query.IndicesQueryCache; */ public class IndexQueryCache extends AbstractIndexComponent implements QueryCache { - final IndicesQueryCache indicesFilterCache; + final IndicesQueryCache indicesQueryCache; @Inject - public IndexQueryCache(Index index, @IndexSettings Settings indexSettings, IndicesQueryCache indicesFilterCache) { + public IndexQueryCache(Index index, @IndexSettings Settings indexSettings, IndicesQueryCache indicesQueryCache) { super(index, indexSettings); - this.indicesFilterCache = indicesFilterCache; + this.indicesQueryCache = indicesQueryCache; } @Override @@ -52,12 +52,12 @@ public class IndexQueryCache extends AbstractIndexComponent implements QueryCach @Override public void clear(String reason) { logger.debug("full cache clear, reason [{}]", reason); - indicesFilterCache.clearIndex(index.getName()); + indicesQueryCache.clearIndex(index.getName()); } @Override public Weight doCache(Weight weight, QueryCachingPolicy policy) { - return indicesFilterCache.doCache(weight, policy); + return indicesQueryCache.doCache(weight, policy); } } diff --git a/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java index 32e695d445e..39e82789bbd 100644 --- a/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/core/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -155,7 +155,7 @@ public class IndexShard extends AbstractIndexShardComponent { private final EngineConfig engineConfig; private final TranslogConfig translogConfig; private final MergePolicyConfig mergePolicyConfig; - private final IndicesQueryCache indicesFilterCache; + private final IndicesQueryCache indicesQueryCache; private final StoreRecoveryService storeRecoveryService; private TimeValue refreshInterval; @@ -192,7 +192,7 @@ public class IndexShard extends AbstractIndexShardComponent { @Inject public IndexShard(ShardId shardId, IndexSettingsService indexSettingsService, IndicesLifecycle indicesLifecycle, Store store, StoreRecoveryService storeRecoveryService, ThreadPool threadPool, MapperService mapperService, IndexQueryParserService queryParserService, IndexCache indexCache, IndexAliasesService indexAliasesService, - IndicesQueryCache indicesFilterCache, ShardPercolateService shardPercolateService, CodecService codecService, + IndicesQueryCache indicesQueryCache, ShardPercolateService shardPercolateService, CodecService codecService, ShardTermVectorsService termVectorsService, IndexFieldDataService indexFieldDataService, IndexService indexService, @Nullable IndicesWarmer warmer, SnapshotDeletionPolicy deletionPolicy, SimilarityService similarityService, EngineFactory factory, ClusterService clusterService, ShardPath path, BigArrays bigArrays) { @@ -219,7 +219,7 @@ public class IndexShard extends AbstractIndexShardComponent { this.termVectorsService = termVectorsService.setIndexShard(this); this.searchService = new ShardSearchStats(indexSettings); this.shardWarmerService = new ShardIndexWarmerService(shardId, indexSettings); - this.indicesFilterCache = indicesFilterCache; + this.indicesQueryCache = indicesQueryCache; this.shardQueryCache = new ShardRequestCache(shardId, indexSettings); this.shardFieldData = new ShardFieldData(); this.percolatorQueriesRegistry = new PercolatorQueriesRegistry(shardId, indexSettings, queryParserService, indexingService, indicesLifecycle, mapperService, indexFieldDataService, shardPercolateService); @@ -616,7 +616,7 @@ public class IndexShard extends AbstractIndexShardComponent { } public QueryCacheStats queryCacheStats() { - return indicesFilterCache.getStats(shardId); + return indicesQueryCache.getStats(shardId); } public FieldDataStats fieldDataStats(String... fields) { diff --git a/core/src/main/java/org/elasticsearch/index/shard/ShadowIndexShard.java b/core/src/main/java/org/elasticsearch/index/shard/ShadowIndexShard.java index 6ec1e3f8ad3..82eb458f6cb 100644 --- a/core/src/main/java/org/elasticsearch/index/shard/ShadowIndexShard.java +++ b/core/src/main/java/org/elasticsearch/index/shard/ShadowIndexShard.java @@ -60,7 +60,7 @@ public final class ShadowIndexShard extends IndexShard { IndicesLifecycle indicesLifecycle, Store store, StoreRecoveryService storeRecoveryService, ThreadPool threadPool, MapperService mapperService, IndexQueryParserService queryParserService, IndexCache indexCache, - IndexAliasesService indexAliasesService, IndicesQueryCache indicesFilterCache, + IndexAliasesService indexAliasesService, IndicesQueryCache indicesQueryCache, ShardPercolateService shardPercolateService, CodecService codecService, ShardTermVectorsService termVectorsService, IndexFieldDataService indexFieldDataService, IndexService indexService, @Nullable IndicesWarmer warmer, @@ -69,7 +69,7 @@ public final class ShadowIndexShard extends IndexShard { ShardPath path, BigArrays bigArrays) throws IOException { super(shardId, indexSettingsService, indicesLifecycle, store, storeRecoveryService, threadPool, mapperService, queryParserService, indexCache, indexAliasesService, - indicesFilterCache, shardPercolateService, codecService, + indicesQueryCache, shardPercolateService, codecService, termVectorsService, indexFieldDataService, indexService, warmer, deletionPolicy, similarityService, factory, clusterService, path, bigArrays); diff --git a/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java b/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java index 2c82ad0b27e..4845555d5fb 100644 --- a/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java +++ b/core/src/main/java/org/elasticsearch/indices/NodeIndicesStats.java @@ -132,12 +132,12 @@ public class NodeIndicesStats implements Streamable, Serializable, ToXContent { } @Nullable - public QueryCacheStats getFilterCache() { + public QueryCacheStats getQueryCache() { return stats.getQueryCache(); } @Nullable - public RequestCacheStats getQueryCache() { + public RequestCacheStats getRequestCache() { return stats.getRequestCache(); } diff --git a/core/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java b/core/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java index b3cc6a4deab..6ce84bf7283 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java @@ -269,11 +269,11 @@ public class RestNodesAction extends AbstractCatAction { table.addCell(fdStats == null ? null : fdStats.getMemorySize()); table.addCell(fdStats == null ? null : fdStats.getEvictions()); - QueryCacheStats fcStats = indicesStats == null ? null : indicesStats.getFilterCache(); + QueryCacheStats fcStats = indicesStats == null ? null : indicesStats.getQueryCache(); table.addCell(fcStats == null ? null : fcStats.getMemorySize()); table.addCell(fcStats == null ? null : fcStats.getEvictions()); - RequestCacheStats qcStats = indicesStats == null ? null : indicesStats.getQueryCache(); + RequestCacheStats qcStats = indicesStats == null ? null : indicesStats.getRequestCache(); table.addCell(qcStats == null ? null : qcStats.getMemorySize()); table.addCell(qcStats == null ? null : qcStats.getEvictions()); table.addCell(qcStats == null ? null : qcStats.getHitCount()); diff --git a/core/src/test/java/org/elasticsearch/indices/stats/IndexStatsTests.java b/core/src/test/java/org/elasticsearch/indices/stats/IndexStatsTests.java index 9a8a37c9a08..b32ad01a491 100644 --- a/core/src/test/java/org/elasticsearch/indices/stats/IndexStatsTests.java +++ b/core/src/test/java/org/elasticsearch/indices/stats/IndexStatsTests.java @@ -41,7 +41,7 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.cache.query.QueryCacheModule; import org.elasticsearch.index.cache.query.QueryCacheStats; -import org.elasticsearch.index.cache.query.QueryCacheModule.FilterCacheSettings; +import org.elasticsearch.index.cache.query.QueryCacheModule.QueryCacheSettings; import org.elasticsearch.index.cache.query.index.IndexQueryCache; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.shard.MergePolicyConfig; @@ -79,8 +79,8 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { //Filter/Query cache is cleaned periodically, default is 60s, so make sure it runs often. Thread.sleep for 60s is bad return Settings.settingsBuilder().put(super.nodeSettings(nodeOrdinal)) .put(IndicesRequestCache.INDICES_CACHE_REQUEST_CLEAN_INTERVAL, "1ms") - .put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, true) - .put(QueryCacheModule.FilterCacheSettings.FILTER_CACHE_TYPE, IndexQueryCache.class) + .put(QueryCacheSettings.QUERY_CACHE_EVERYTHING, true) + .put(QueryCacheModule.QueryCacheSettings.QUERY_CACHE_TYPE, IndexQueryCache.class) .build(); } @@ -143,7 +143,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { NodesStatsResponse nodesStats = client().admin().cluster().prepareNodesStats().setIndices(true) .execute().actionGet(); assertThat(nodesStats.getNodes()[0].getIndices().getFieldData().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getFieldData().getMemorySizeInBytes(), equalTo(0l)); - assertThat(nodesStats.getNodes()[0].getIndices().getFilterCache().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getFilterCache().getMemorySizeInBytes(), equalTo(0l)); + assertThat(nodesStats.getNodes()[0].getIndices().getQueryCache().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getQueryCache().getMemorySizeInBytes(), equalTo(0l)); IndicesStatsResponse indicesStats = client().admin().indices().prepareStats("test") .clear().setFieldData(true).setQueryCache(true) @@ -164,7 +164,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { nodesStats = client().admin().cluster().prepareNodesStats().setIndices(true) .execute().actionGet(); assertThat(nodesStats.getNodes()[0].getIndices().getFieldData().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getFieldData().getMemorySizeInBytes(), greaterThan(0l)); - assertThat(nodesStats.getNodes()[0].getIndices().getFilterCache().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getFilterCache().getMemorySizeInBytes(), greaterThan(0l)); + assertThat(nodesStats.getNodes()[0].getIndices().getQueryCache().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getQueryCache().getMemorySizeInBytes(), greaterThan(0l)); indicesStats = client().admin().indices().prepareStats("test") .clear().setFieldData(true).setQueryCache(true) @@ -177,7 +177,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { nodesStats = client().admin().cluster().prepareNodesStats().setIndices(true) .execute().actionGet(); assertThat(nodesStats.getNodes()[0].getIndices().getFieldData().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getFieldData().getMemorySizeInBytes(), equalTo(0l)); - assertThat(nodesStats.getNodes()[0].getIndices().getFilterCache().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getFilterCache().getMemorySizeInBytes(), equalTo(0l)); + assertThat(nodesStats.getNodes()[0].getIndices().getQueryCache().getMemorySizeInBytes() + nodesStats.getNodes()[1].getIndices().getQueryCache().getMemorySizeInBytes(), equalTo(0l)); indicesStats = client().admin().indices().prepareStats("test") .clear().setFieldData(true).setQueryCache(true) @@ -970,7 +970,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { assertEquals(stats1.getTotalCount(), stats2.getTotalCount()); } - private void assertCumulativeFilterCacheStats(IndicesStatsResponse response) { + private void assertCumulativeQueryCacheStats(IndicesStatsResponse response) { assertAllSuccessful(response); QueryCacheStats total = response.getTotal().queryCache; QueryCacheStats indexTotal = new QueryCacheStats(); @@ -993,13 +993,13 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { ensureGreen(); IndicesStatsResponse response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); - assertCumulativeFilterCacheStats(response); + assertCumulativeQueryCacheStats(response); assertEquals(0, response.getTotal().queryCache.getCacheSize()); SearchResponse r; assertSearchResponse(r = client().prepareSearch("index").setQuery(QueryBuilders.constantScoreQuery(QueryBuilders.matchQuery("foo", "baz"))).get()); response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); - assertCumulativeFilterCacheStats(response); + assertCumulativeQueryCacheStats(response); assertThat(response.getTotal().queryCache.getHitCount(), equalTo(0L)); assertThat(response.getTotal().queryCache.getEvictions(), equalTo(0L)); assertThat(response.getTotal().queryCache.getMissCount(), greaterThan(0L)); @@ -1007,7 +1007,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { assertSearchResponse(client().prepareSearch("index").setQuery(QueryBuilders.constantScoreQuery(QueryBuilders.matchQuery("foo", "baz"))).get()); response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); - assertCumulativeFilterCacheStats(response); + assertCumulativeQueryCacheStats(response); assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getEvictions(), equalTo(0L)); assertThat(response.getTotal().queryCache.getMissCount(), greaterThan(0L)); @@ -1017,7 +1017,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { assertTrue(client().prepareDelete("index", "type", "2").get().isFound()); refresh(); response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); - assertCumulativeFilterCacheStats(response); + assertCumulativeQueryCacheStats(response); assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getEvictions(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getCacheSize(), equalTo(0L)); @@ -1029,7 +1029,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { assertSearchResponse(client().prepareSearch("index").setQuery(QueryBuilders.constantScoreQuery(QueryBuilders.matchQuery("foo", "baz"))).get()); response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); - assertCumulativeFilterCacheStats(response); + assertCumulativeQueryCacheStats(response); assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getEvictions(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getMissCount(), greaterThan(0L)); @@ -1038,7 +1038,7 @@ public class IndexStatsTests extends ElasticsearchIntegrationTest { assertAllSuccessful(client().admin().indices().prepareClearCache("index").setQueryCache(true).get()); response = client().admin().indices().prepareStats("index").setQueryCache(true).get(); - assertCumulativeFilterCacheStats(response); + assertCumulativeQueryCacheStats(response); assertThat(response.getTotal().queryCache.getHitCount(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getEvictions(), greaterThan(0L)); assertThat(response.getTotal().queryCache.getMissCount(), greaterThan(0L)); diff --git a/core/src/test/java/org/elasticsearch/search/child/ChildQuerySearchTests.java b/core/src/test/java/org/elasticsearch/search/child/ChildQuerySearchTests.java index 92d019e1c92..f89946a58cf 100644 --- a/core/src/test/java/org/elasticsearch/search/child/ChildQuerySearchTests.java +++ b/core/src/test/java/org/elasticsearch/search/child/ChildQuerySearchTests.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.lucene.search.function.CombineFunction; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.cache.query.QueryCacheModule; -import org.elasticsearch.index.cache.query.QueryCacheModule.FilterCacheSettings; +import org.elasticsearch.index.cache.query.QueryCacheModule.QueryCacheSettings; import org.elasticsearch.index.cache.query.index.IndexQueryCache; import org.elasticsearch.index.mapper.MergeMappingException; import org.elasticsearch.index.query.HasChildQueryBuilder; @@ -75,8 +75,8 @@ public class ChildQuerySearchTests extends ElasticsearchIntegrationTest { protected Settings nodeSettings(int nodeOrdinal) { return Settings.settingsBuilder().put(super.nodeSettings(nodeOrdinal)) // aggressive filter caching so that we can assert on the filter cache size - .put(QueryCacheModule.FilterCacheSettings.FILTER_CACHE_TYPE, IndexQueryCache.class) - .put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, true) + .put(QueryCacheModule.QueryCacheSettings.QUERY_CACHE_TYPE, IndexQueryCache.class) + .put(QueryCacheSettings.QUERY_CACHE_EVERYTHING, true) .build(); } diff --git a/core/src/test/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchTests.java b/core/src/test/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchTests.java index 2569e7b3f45..17a9c0f491c 100644 --- a/core/src/test/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchTests.java +++ b/core/src/test/java/org/elasticsearch/search/scriptfilter/ScriptQuerySearchTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.search.scriptfilter; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.cache.query.QueryCacheModule; -import org.elasticsearch.index.cache.query.QueryCacheModule.FilterCacheSettings; +import org.elasticsearch.index.cache.query.QueryCacheModule.QueryCacheSettings; import org.elasticsearch.index.cache.query.index.IndexQueryCache; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService.ScriptType; @@ -51,8 +51,8 @@ public class ScriptQuerySearchTests extends ElasticsearchIntegrationTest { protected Settings nodeSettings(int nodeOrdinal) { return Settings.settingsBuilder().put(super.nodeSettings(nodeOrdinal)) // aggressive filter caching so that we can assert on the number of iterations of the script filters - .put(QueryCacheModule.FilterCacheSettings.FILTER_CACHE_TYPE, IndexQueryCache.class) - .put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, true) + .put(QueryCacheModule.QueryCacheSettings.QUERY_CACHE_TYPE, IndexQueryCache.class) + .put(QueryCacheSettings.QUERY_CACHE_EVERYTHING, true) .build(); } diff --git a/core/src/test/java/org/elasticsearch/test/ExternalTestCluster.java b/core/src/test/java/org/elasticsearch/test/ExternalTestCluster.java index 228bf05ff41..e7258ca43c9 100644 --- a/core/src/test/java/org/elasticsearch/test/ExternalTestCluster.java +++ b/core/src/test/java/org/elasticsearch/test/ExternalTestCluster.java @@ -142,7 +142,7 @@ public final class ExternalTestCluster extends TestCluster { // turn increments the breaker, making it non-0 assertThat("Fielddata size must be 0 on node: " + stats.getNode(), stats.getIndices().getFieldData().getMemorySizeInBytes(), equalTo(0l)); - assertThat("Filter cache size must be 0 on node: " + stats.getNode(), stats.getIndices().getFilterCache().getMemorySizeInBytes(), equalTo(0l)); + assertThat("Query cache size must be 0 on node: " + stats.getNode(), stats.getIndices().getQueryCache().getMemorySizeInBytes(), equalTo(0l)); assertThat("FixedBitSet cache size must be 0 on node: " + stats.getNode(), stats.getIndices().getSegments().getBitsetMemoryInBytes(), equalTo(0l)); } } diff --git a/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java b/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java index 2b1b8b5bcf6..b8da49e8345 100644 --- a/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java +++ b/core/src/test/java/org/elasticsearch/test/InternalTestCluster.java @@ -73,7 +73,7 @@ import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.cache.query.QueryCacheModule; -import org.elasticsearch.index.cache.query.QueryCacheModule.FilterCacheSettings; +import org.elasticsearch.index.cache.query.QueryCacheModule.QueryCacheSettings; import org.elasticsearch.index.cache.query.index.IndexQueryCache; import org.elasticsearch.index.cache.query.none.NoneQueryCache; import org.elasticsearch.index.engine.CommitStats; @@ -438,11 +438,11 @@ public final class InternalTestCluster extends TestCluster { } if (random.nextBoolean()) { - builder.put(QueryCacheModule.FilterCacheSettings.FILTER_CACHE_TYPE, random.nextBoolean() ? IndexQueryCache.class : NoneQueryCache.class); + builder.put(QueryCacheModule.QueryCacheSettings.QUERY_CACHE_TYPE, random.nextBoolean() ? IndexQueryCache.class : NoneQueryCache.class); } if (random.nextBoolean()) { - builder.put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, random.nextBoolean()); + builder.put(QueryCacheSettings.QUERY_CACHE_EVERYTHING, random.nextBoolean()); } if (random.nextBoolean()) { @@ -1807,7 +1807,7 @@ public final class InternalTestCluster extends TestCluster { NodeService nodeService = getInstanceFromNode(NodeService.class, nodeAndClient.node); NodeStats stats = nodeService.stats(CommonStatsFlags.ALL, false, false, false, false, false, false, false, false, false); assertThat("Fielddata size must be 0 on node: " + stats.getNode(), stats.getIndices().getFieldData().getMemorySizeInBytes(), equalTo(0l)); - assertThat("Filter cache size must be 0 on node: " + stats.getNode(), stats.getIndices().getFilterCache().getMemorySizeInBytes(), equalTo(0l)); + assertThat("Query cache size must be 0 on node: " + stats.getNode(), stats.getIndices().getQueryCache().getMemorySizeInBytes(), equalTo(0l)); assertThat("FixedBitSet cache size must be 0 on node: " + stats.getNode(), stats.getIndices().getSegments().getBitsetMemoryInBytes(), equalTo(0l)); } }