Interface PreparedStatementCache

All Known Implementing Classes:
MapPreparedStatementCache

@Deprecated public interface PreparedStatementCache
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 Type
    Method
    Description
    Deprecated.
    Create a default cache backed by a ConcurrentHashMap.
    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 a PreparedStatement by CqlSession and SimpleStatement.
    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 a PreparedStatement by CqlSession and SimpleStatement.
  • Method Details

    • create

      static PreparedStatementCache create()
      Deprecated.
      Create a default cache backed by a ConcurrentHashMap.
      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 a PreparedStatement by CqlSession and SimpleStatement.
      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 a PreparedStatement by CqlSession and SimpleStatement.
      Parameters:
      session - must not be null.
      statement - must not be null.
      preparer - must not be null.
      Returns:
      the PreparedStatement.