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
Modifier and TypeClassDescriptionprotected static class
Deprecated.MapPreparedStatementCache.CacheKey
forPreparedStatement
caching. -
Method Summary
Modifier and TypeMethodDescriptionstatic MapPreparedStatementCache
create()
Deprecated.Create aMapPreparedStatementCache
usingConcurrentHashMap
.protected Map<MapPreparedStatementCache.CacheKey,
com.datastax.oss.driver.api.core.cql.PreparedStatement> getCache()
Deprecated.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.Obtain aPreparedStatement
byCqlSession
andSimpleStatement
.static MapPreparedStatementCache
of
(Map<MapPreparedStatementCache.CacheKey, com.datastax.oss.driver.api.core.cql.PreparedStatement> cache) Deprecated.Create aMapPreparedStatementCache
using the givenMap
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.cassandra.core.cql.support.PreparedStatementCache
getPreparedStatement
-
Method Details
-
create
Deprecated.Create aMapPreparedStatementCache
usingConcurrentHashMap
.- Returns:
- the new
MapPreparedStatementCache
backed byConcurrentHashMap
.
-
of
public static MapPreparedStatementCache of(Map<MapPreparedStatementCache.CacheKey, com.datastax.oss.driver.api.core.cql.PreparedStatement> cache) Deprecated.Create aMapPreparedStatementCache
using the givenMap
.- Returns:
- the new
MapPreparedStatementCache
backed 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:PreparedStatementCache
Obtain aPreparedStatement
byCqlSession
andSimpleStatement
.- Specified by:
getPreparedStatement
in interfacePreparedStatementCache
- Parameters:
session
- must not be null.statement
- must not be null.preparer
- must not be null.- Returns:
- the
PreparedStatement
.
-