diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java index cb9c6c21bf..af0370aab5 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -1593,7 +1593,7 @@ public interface AvailableSettings { /** * When enabled, specifies that {@linkplain QueryPlan query plans} should be - * {@linkplain org.hibernate.query.spi.QueryPlanCache cached}. + * {@linkplain org.hibernate.query.spi.QueryInterpretationCache cached}. *

* By default, the query plan cache is disabled, unless one of the configuration * properties {@value #QUERY_PLAN_CACHE_MAX_SIZE} or @@ -1603,14 +1603,13 @@ public interface AvailableSettings { /** * The maximum number of entries in the - * {@linkplain org.hibernate.query.spi.QueryPlanCache query plan cache} or * {@linkplain org.hibernate.query.spi.QueryInterpretationCache * query interpretation cache}. *

* The default maximum is * {@value org.hibernate.query.spi.QueryEngine#DEFAULT_QUERY_PLAN_MAX_COUNT}. * - * @see org.hibernate.query.spi.QueryPlanCache + * @see org.hibernate.query.spi.QueryInterpretationCache */ String QUERY_PLAN_CACHE_MAX_SIZE = "hibernate.query.plan_cache_max_size"; diff --git a/hibernate-core/src/main/java/org/hibernate/query/internal/QueryInterpretationCacheStandardImpl.java b/hibernate-core/src/main/java/org/hibernate/query/internal/QueryInterpretationCacheStandardImpl.java index 72e43ce796..b56310f7de 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/internal/QueryInterpretationCacheStandardImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/query/internal/QueryInterpretationCacheStandardImpl.java @@ -45,7 +45,7 @@ public class QueryInterpretationCacheStandardImpl implements QueryInterpretation private final Supplier statisticsSupplier; public QueryInterpretationCacheStandardImpl(int maxQueryPlanCount, Supplier statisticsSupplier) { - log.debugf( "Starting QueryPlanCache(%s)", maxQueryPlanCount ); + log.debugf( "Starting QueryInterpretationCache(%s)", maxQueryPlanCount ); this.queryPlanCache = new BoundedConcurrentHashMap<>( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS ); this.hqlInterpretationCache = new BoundedConcurrentHashMap<>( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS ); diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryInterpretationCache.java b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryInterpretationCache.java index c721156272..c101e577ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryInterpretationCache.java +++ b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryInterpretationCache.java @@ -16,6 +16,7 @@ /** * Cache for various parts of translating or interpreting queries. * + * @see org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_ENABLED * @see org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_MAX_SIZE * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryPlanCache.java b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryPlanCache.java deleted file mode 100644 index 7a5646d122..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryPlanCache.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later - * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html - */ -package org.hibernate.query.spi; - -import org.hibernate.query.sqm.tree.SqmStatement; - -/** - * A cache for {@link QueryPlan}s used (and produced) by the translation - * and execution of a query. - * - * @see org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_ENABLED - * @see org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_MAX_SIZE - * - * @author Steve Ebersole - */ -public interface QueryPlanCache { - interface Key { - } - - SelectQueryPlan getSelectQueryPlan(Key key); - void cacheSelectQueryPlan(Key key, SelectQueryPlan plan); - - NonSelectQueryPlan getNonSelectQueryPlan(Key key); - void cacheNonSelectQueryPlan(Key key, NonSelectQueryPlan plan); - - // todo (6.0) : create a SqmStatementCache ? - SqmStatement getSqmStatement(String queryString); - void cacheSqmStatement(String key, SqmStatement sqmStatement); - - /** - * Close the cache when the SessionFactory is closed. - *

- * Note that depending on the cache strategy implementation chosen, clearing the cache might not reclaim all the - * memory. - *

- * Typically, when using LIRS, clearing the cache only invalidates the entries but the outdated entries are kept in - * memory until they are replaced by others. It is not considered a memory leak as the cache is bounded. - */ - void close(); -}