remove unused interface QueryPlanCache
This commit is contained in:
parent
d6ffb75251
commit
f13b6cc16b
|
@ -1593,7 +1593,7 @@ public interface AvailableSettings {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When enabled, specifies that {@linkplain QueryPlan query plans} should be
|
* When enabled, specifies that {@linkplain QueryPlan query plans} should be
|
||||||
* {@linkplain org.hibernate.query.spi.QueryPlanCache cached}.
|
* {@linkplain org.hibernate.query.spi.QueryInterpretationCache cached}.
|
||||||
* <p>
|
* <p>
|
||||||
* By default, the query plan cache is disabled, unless one of the configuration
|
* By default, the query plan cache is disabled, unless one of the configuration
|
||||||
* properties {@value #QUERY_PLAN_CACHE_MAX_SIZE} or
|
* properties {@value #QUERY_PLAN_CACHE_MAX_SIZE} or
|
||||||
|
@ -1603,14 +1603,13 @@ public interface AvailableSettings {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum number of entries in the
|
* The maximum number of entries in the
|
||||||
* {@linkplain org.hibernate.query.spi.QueryPlanCache query plan cache} or
|
|
||||||
* {@linkplain org.hibernate.query.spi.QueryInterpretationCache
|
* {@linkplain org.hibernate.query.spi.QueryInterpretationCache
|
||||||
* query interpretation cache}.
|
* query interpretation cache}.
|
||||||
* <p>
|
* <p>
|
||||||
* The default maximum is
|
* The default maximum is
|
||||||
* {@value org.hibernate.query.spi.QueryEngine#DEFAULT_QUERY_PLAN_MAX_COUNT}.
|
* {@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";
|
String QUERY_PLAN_CACHE_MAX_SIZE = "hibernate.query.plan_cache_max_size";
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class QueryInterpretationCacheStandardImpl implements QueryInterpretation
|
||||||
private final Supplier<StatisticsImplementor> statisticsSupplier;
|
private final Supplier<StatisticsImplementor> statisticsSupplier;
|
||||||
|
|
||||||
public QueryInterpretationCacheStandardImpl(int maxQueryPlanCount, Supplier<StatisticsImplementor> statisticsSupplier) {
|
public QueryInterpretationCacheStandardImpl(int maxQueryPlanCount, Supplier<StatisticsImplementor> statisticsSupplier) {
|
||||||
log.debugf( "Starting QueryPlanCache(%s)", maxQueryPlanCount );
|
log.debugf( "Starting QueryInterpretationCache(%s)", maxQueryPlanCount );
|
||||||
|
|
||||||
this.queryPlanCache = new BoundedConcurrentHashMap<>( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS );
|
this.queryPlanCache = new BoundedConcurrentHashMap<>( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS );
|
||||||
this.hqlInterpretationCache = new BoundedConcurrentHashMap<>( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS );
|
this.hqlInterpretationCache = new BoundedConcurrentHashMap<>( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS );
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.hibernate.query.sqm.tree.SqmStatement;
|
||||||
/**
|
/**
|
||||||
* Cache for various parts of translating or interpreting queries.
|
* 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
|
* @see org.hibernate.cfg.AvailableSettings#QUERY_PLAN_CACHE_MAX_SIZE
|
||||||
*
|
*
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
|
|
@ -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.
|
|
||||||
* <p>
|
|
||||||
* Note that depending on the cache strategy implementation chosen, clearing the cache might not reclaim all the
|
|
||||||
* memory.
|
|
||||||
* <p>
|
|
||||||
* 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();
|
|
||||||
}
|
|
Loading…
Reference in New Issue