Package com.mckoi.database
Class StatementCache
java.lang.Object
com.mckoi.database.StatementCache
A cache that maintains a serialized set of StatementTree objects that can
be deserialized on demand. The purpose of this cache is to improve the
performance of queries that are run repeatedly (for example, multiple
INSERT statements).
SYNCHRONIZATION: This object is safe to use over multiple threads.
- Author:
- Tobias Downer
-
Constructor Summary
ConstructorsConstructorDescriptionStatementCache
(DatabaseSystem system, int hash_size, int max_size, int clean_percentage) Constructs the cache. -
Method Summary
Modifier and TypeMethodDescriptionfinal DebugLogger
Debug()
Returns a DebugLogger object we can use to log debug messages.Gets a StatementTree for the query string if it is stored in the cache.void
put
(String query_string, StatementTree statement_tree) Puts a new query string/StatementTree into the cache.
-
Constructor Details
-
StatementCache
Constructs the cache.
-
-
Method Details
-
Debug
Returns a DebugLogger object we can use to log debug messages. -
put
Puts a new query string/StatementTree into the cache. -
get
Gets a StatementTree for the query string if it is stored in the cache. If it isn't stored in the cache returns null.
-