diff --git a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java index d4fe0fe1ddd..e4731919fa7 100644 --- a/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java +++ b/modules/percolator/src/test/java/org/elasticsearch/percolator/PercolateQueryBuilderTests.java @@ -269,7 +269,7 @@ public class PercolateQueryBuilderTests extends AbstractQueryTestCase frozen = new SetOnce<>(); private final Index fullyQualifiedIndex; @@ -333,7 +333,7 @@ public class QueryShardContext extends QueryRewriteContext { * class says a request can be cached. */ protected final void failIfFrozen() { - this.cachable = false; + this.cacheable = false; if (frozen.get() == Boolean.TRUE) { throw new IllegalArgumentException("features that prevent cachability are disabled on this context"); } else { @@ -354,10 +354,10 @@ public class QueryShardContext extends QueryRewriteContext { } /** - * Returns true iff the result of the processed search request is cachable. Otherwise false + * Returns true iff the result of the processed search request is cacheable. Otherwise false */ - public final boolean isCachable() { - return cachable; + public final boolean isCacheable() { + return cacheable; } /** diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index 19388a2b63d..32d94052f6c 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -1212,7 +1212,7 @@ public class IndicesService extends AbstractLifecycleComponent // if now in millis is used (or in the future, a more generic "isDeterministic" flag // then we can't cache based on "now" key within the search request, as it is not deterministic - if (context.getQueryShardContext().isCachable() == false) { + if (context.getQueryShardContext().isCacheable() == false) { return false; } return true; diff --git a/server/src/main/java/org/elasticsearch/search/SearchService.java b/server/src/main/java/org/elasticsearch/search/SearchService.java index 500e70a65b4..24cc4b45b74 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchService.java +++ b/server/src/main/java/org/elasticsearch/search/SearchService.java @@ -691,7 +691,7 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv // during rewrite and normalized / evaluate templates etc. QueryShardContext context = new QueryShardContext(searchContext.getQueryShardContext()); Rewriteable.rewrite(request.getRewriteable(), context, assertAsyncActions); - assert searchContext.getQueryShardContext().isCachable(); + assert searchContext.getQueryShardContext().isCacheable(); success = true; } finally { if (success == false) { diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecisionTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecisionTests.java index 3fcd743a8a1..14ed16f82de 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecisionTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/allocation/AllocateUnassignedDecisionTests.java @@ -136,9 +136,9 @@ public class AllocateUnassignedDecisionTests extends ESTestCase { } public void testCachedDecisions() { - List cachableStatuses = Arrays.asList(AllocationStatus.DECIDERS_NO, AllocationStatus.DECIDERS_THROTTLED, + List cacheableStatuses = Arrays.asList(AllocationStatus.DECIDERS_NO, AllocationStatus.DECIDERS_THROTTLED, AllocationStatus.NO_VALID_SHARD_COPY, AllocationStatus.FETCHING_SHARD_DATA, AllocationStatus.DELAYED_ALLOCATION); - for (AllocationStatus allocationStatus : cachableStatuses) { + for (AllocationStatus allocationStatus : cacheableStatuses) { if (allocationStatus == AllocationStatus.DECIDERS_THROTTLED) { AllocateUnassignedDecision cached = AllocateUnassignedDecision.throttle(null); AllocateUnassignedDecision another = AllocateUnassignedDecision.throttle(null); diff --git a/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java b/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java index 5615944219c..d6a45a165d1 100644 --- a/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java +++ b/server/src/test/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilderTests.java @@ -334,7 +334,7 @@ public class MoreLikeThisQueryBuilderTests extends AbstractQueryTestCase> public void testToQuery() throws IOException { for (int runs = 0; runs < NUMBER_OF_TESTQUERIES; runs++) { QueryShardContext context = createShardContext(); - assert context.isCachable(); + assert context.isCacheable(); context.setAllowUnmappedFields(true); QB firstQuery = createTestQueryBuilder(); QB controlQuery = copyQuery(firstQuery); @@ -426,12 +426,12 @@ public abstract class AbstractQueryTestCase> * we first rewrite the query with a private context, then reset the context and then build the actual lucene query*/ QueryBuilder rewritten = rewriteQuery(firstQuery, new QueryShardContext(context)); Query firstLuceneQuery = rewritten.toQuery(context); - if (isCachable(firstQuery)) { + if (isCacheable(firstQuery)) { assertTrue("query was marked as not cacheable in the context but this test indicates it should be cacheable: " - + firstQuery.toString(), context.isCachable()); + + firstQuery.toString(), context.isCacheable()); } else { assertFalse("query was marked as cacheable in the context but this test indicates it should not be cacheable: " - + firstQuery.toString(), context.isCachable()); + + firstQuery.toString(), context.isCacheable()); } assertNotNull("toQuery should not return null", firstLuceneQuery); assertLuceneQuery(firstQuery, firstLuceneQuery, searchContext); @@ -476,7 +476,7 @@ public abstract class AbstractQueryTestCase> return rewritten; } - protected boolean isCachable(QB queryBuilder) { + protected boolean isCacheable(QB queryBuilder) { return true; }