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 PreparedStatementCachecreate()Deprecated.Create a default cache backed by aConcurrentHashMap.default 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) Deprecated.Obtain aPreparedStatementbyCqlSessionandSimpleStatement.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.
-
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 aPreparedStatementbyCqlSessionandSimpleStatement.- 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 aPreparedStatementbyCqlSessionandSimpleStatement.- Parameters:
session- must not be null.statement- must not be null.preparer- must not be null.- Returns:
- the
PreparedStatement.
-