java.lang.Object
org.litebridge.orm.engine.QueryPlanCache
Caches SQL execution plans based on the structural fingerprint of a
Select operation.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the cache.@Nullable QueryPlanCache.CachedOperationget(int nodeHash) Retrieves a cached execution plan for the given select operation.@Nullable QueryPlanCache.CachedOperationRetrieves a cached execution plan for the given select operation.voidput(int nodeHash, QueryPlanCache.CachedOperation cachedOperation) Stores an execution plan in the cache.voidput(QueryNode node, QueryPlanCache.CachedOperation cachedOperation) Stores an execution plan in the cache.intsize()Returns the current cache size.
-
Constructor Details
-
QueryPlanCache
public QueryPlanCache()
-
-
Method Details
-
get
Retrieves a cached execution plan for the given select operation.- Parameters:
node- the AST terminating node- Returns:
- the cached prepared SQL, or
nullif not found
-
get
Retrieves a cached execution plan for the given select operation.- Parameters:
nodeHash- the AST terminating node hash- Returns:
- the cached prepared SQL, or
nullif not found
-
put
Stores an execution plan in the cache.- Parameters:
node- the AST terminating node
-
put
Stores an execution plan in the cache.- Parameters:
nodeHash- the AST terminating node hash
-
size
public int size()Returns the current cache size.- Returns:
- the current cache size.
-
clear
public void clear()Clears the cache.
-