@Deprecated public class CachedPreparedStatementCreator extends Object implements PreparedStatementCreator
PreparedStatementCreator implementation using caching of prepared statements.
Regular CQL statements are prepared on first use and executed as prepared statements. Prepared statements are cached
by Cassandra itself (invalidation/eviction possible), in the driver to be able to re-prepare a statement and in this
CachedPreparedStatementCreator using PreparedStatementCache.PreparedStatementCache| Modifier | Constructor and Description |
|---|---|
protected |
CachedPreparedStatementCreator(PreparedStatementCache cache,
com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Deprecated.
Create a new
CachedPreparedStatementCreator. |
| Modifier and Type | Method and Description |
|---|---|
com.datastax.oss.driver.api.core.cql.PreparedStatement |
createPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session)
Deprecated.
Create a statement in this session.
|
PreparedStatementCache |
getCache()
Deprecated.
|
static CachedPreparedStatementCreator |
of(PreparedStatementCache cache,
com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
Deprecated.
Create a new
CachedPreparedStatementCreator given PreparedStatementCache and
SimpleStatement to prepare. |
static CachedPreparedStatementCreator |
of(PreparedStatementCache cache,
String cql)
Deprecated.
|
static CachedPreparedStatementCreator |
of(PreparedStatementCache cache,
String cql,
QueryOptions queryOptions)
Deprecated.
|
protected CachedPreparedStatementCreator(PreparedStatementCache cache, com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
CachedPreparedStatementCreator.cache - must not be null.statement - must not be null.public static CachedPreparedStatementCreator of(PreparedStatementCache cache, com.datastax.oss.driver.api.core.cql.SimpleStatement statement)
CachedPreparedStatementCreator given PreparedStatementCache and
SimpleStatement to prepare. Subsequent calls require the a SimpleStatement object with the same CQL
test for a cache hit. Otherwise, the statement is likely to be re-prepared.cache - must not be null.statement - must not be null.CachedPreparedStatementCreator for Statement.public static CachedPreparedStatementCreator of(PreparedStatementCache cache, String cql)
CachedPreparedStatementCreator given PreparedStatementCache and cql to
prepare. Subsequent calls require the a CQL statement that are equal to the
previously used CQL string for a cache hit. Otherwise, the statement is likely to be re-prepared.cache - must not be null.cql - must not be null or empty.CachedPreparedStatementCreator for cql.public static CachedPreparedStatementCreator of(PreparedStatementCache cache, String cql, QueryOptions queryOptions)
CachedPreparedStatementCreator given PreparedStatementCache and cql to
prepare. This method applies QueryOptions to the SimpleStatement before preparing it. Subsequent
calls require the a CQL statement that are equal to the previously used CQL string
for a cache hit. Otherwise, the statement is likely to be re-prepared.cache - must not be null.cql - must not be null or empty.queryOptions - must not be null.CachedPreparedStatementCreator for cql.public PreparedStatementCache getCache()
PreparedStatementCache.public com.datastax.oss.driver.api.core.cql.PreparedStatement createPreparedStatement(com.datastax.oss.driver.api.core.CqlSession session)
throws com.datastax.oss.driver.api.core.DriverException
PreparedStatementCreatorPreparedStatement.createPreparedStatement in interface PreparedStatementCreatorsession - CqlSession to use to create statement.com.datastax.oss.driver.api.core.DriverException - there is no need to catch DriverException that may be thrown in the implementation
of this method. The CqlTemplate class will handle them.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.