Interface PreparedStatementCache
- All Known Implementing Classes:
MapPreparedStatementCache
Deprecated.
since 3.2, the Cassandra driver has a built-in prepared statement cache with makes external caching of
prepared statements superfluous.
Cache interface to synchronously prepare CQL statements.
Implementing classes of PreparedStatementCache
come with own synchronization and cache implementation
characteristics. A cache implementation should optimize for reduction of preparation calls and cache statements using
Cassandras cache key which is specific to the Cluster, keyspace, and CQL text.
- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
PreparedStatement
-
Method Summary
Modifier and TypeMethodDescriptionstatic PreparedStatementCache
create()
Deprecated.Create a default cache backed by aConcurrentHashMap
.default 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) Deprecated.Obtain aPreparedStatement
byCqlSession
andSimpleStatement
.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
.
-
Method Details
-
create
Deprecated.Create a default cache backed by aConcurrentHashMap
.- Returns:
- a new
MapPreparedStatementCache
.
-
getPreparedStatement
default 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) Deprecated.Obtain aPreparedStatement
byCqlSession
andSimpleStatement
.- Parameters:
session
- must not be null.statement
- must not be null.- Returns:
- the
PreparedStatement
.
-
getPreparedStatement
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
.- Parameters:
session
- must not be null.statement
- must not be null.preparer
- must not be null.- Returns:
- the
PreparedStatement
.
-