public class MapPreparedStatementCache extends Object implements PreparedStatementCache
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.| Modifier and Type | Class and Description |
|---|---|
protected static class |
MapPreparedStatementCache.CacheKey
MapPreparedStatementCache.CacheKey for PreparedStatement caching. |
| Modifier and Type | Method and Description |
|---|---|
static MapPreparedStatementCache |
create()
Create a
MapPreparedStatementCache using ConcurrentHashMap. |
protected Map<MapPreparedStatementCache.CacheKey,com.datastax.oss.driver.api.core.cql.PreparedStatement> |
getCache() |
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)
Obtain a
PreparedStatement by CqlSession and SimpleStatement. |
static MapPreparedStatementCache |
of(Map<MapPreparedStatementCache.CacheKey,com.datastax.oss.driver.api.core.cql.PreparedStatement> cache)
Create a
MapPreparedStatementCache using the given Map. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPreparedStatementpublic static MapPreparedStatementCache create()
MapPreparedStatementCache using ConcurrentHashMap.create in interface PreparedStatementCacheMapPreparedStatementCache backed by ConcurrentHashMap.public static MapPreparedStatementCache of(Map<MapPreparedStatementCache.CacheKey,com.datastax.oss.driver.api.core.cql.PreparedStatement> cache)
MapPreparedStatementCache using the given Map.MapPreparedStatementCache backed the given Map.protected Map<MapPreparedStatementCache.CacheKey,com.datastax.oss.driver.api.core.cql.PreparedStatement> getCache()
cache.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)
PreparedStatementCachePreparedStatement by CqlSession and SimpleStatement.getPreparedStatement in interface PreparedStatementCachesession - must not be null.statement - must not be null.preparer - must not be null.PreparedStatement.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.