Class MapPreparedStatementCache
java.lang.Object
org.springframework.data.cassandra.core.cql.support.MapPreparedStatementCache
- All Implemented Interfaces:
PreparedStatementCache
Deprecated.
since 3.2, the Cassandra driver has a built-in prepared statement cache with makes external caching of
prepared statements superfluous.
PreparedStatementCache backed by a Map cache. Defaults to simple ConcurrentHashMap caching.
Statements are cached with a key consisting of session name, keyspace and the
cql text. Statement options (idempotency, timeouts) apply from the statement that was initially prepared.
- Since:
- 2.0
- Author:
- Mark Paluch, Aldo Bongio
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classDeprecated.MapPreparedStatementCache.CacheKeyforPreparedStatementcaching. -
Method Summary
Modifier and TypeMethodDescriptionstatic MapPreparedStatementCachecreate()Deprecated.Create aMapPreparedStatementCacheusingConcurrentHashMap.protected Map<MapPreparedStatementCache.CacheKey,com.datastax.oss.driver.api.core.cql.PreparedStatement> getCache()Deprecated.com.datastax.oss.driver.api.core.cql.PreparedStatementgetPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session, com.datastax.oss.driver.api.core.cql.SimpleStatement statement, Supplier<com.datastax.oss.driver.api.core.cql.PreparedStatement> preparer) Deprecated.Obtain aPreparedStatementbyCqlSessionandSimpleStatement.static MapPreparedStatementCacheof(Map<MapPreparedStatementCache.CacheKey, com.datastax.oss.driver.api.core.cql.PreparedStatement> cache) Deprecated.Create aMapPreparedStatementCacheusing the givenMap.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.cassandra.core.cql.support.PreparedStatementCache
getPreparedStatement
-
Method Details
-
create
Deprecated.Create aMapPreparedStatementCacheusingConcurrentHashMap.- Returns:
- the new
MapPreparedStatementCachebacked byConcurrentHashMap.
-
of
public static MapPreparedStatementCache of(Map<MapPreparedStatementCache.CacheKey, com.datastax.oss.driver.api.core.cql.PreparedStatement> cache) Deprecated.Create aMapPreparedStatementCacheusing the givenMap.- Returns:
- the new
MapPreparedStatementCachebacked the givenMap.
-
getCache
protected Map<MapPreparedStatementCache.CacheKey,com.datastax.oss.driver.api.core.cql.PreparedStatement> getCache()Deprecated.- Returns:
- the underlying
cache.
-
getPreparedStatement
public com.datastax.oss.driver.api.core.cql.PreparedStatement getPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session, com.datastax.oss.driver.api.core.cql.SimpleStatement statement, Supplier<com.datastax.oss.driver.api.core.cql.PreparedStatement> preparer) Deprecated.Description copied from interface:PreparedStatementCacheObtain aPreparedStatementbyCqlSessionandSimpleStatement.- Specified by:
getPreparedStatementin interfacePreparedStatementCache- Parameters:
session- must not be null.statement- must not be null.preparer- must not be null.- Returns:
- the
PreparedStatement.
-