Class BaseJdbcStore<K,V,C extends AbstractJdbcStoreConfiguration>
java.lang.Object
org.infinispan.persistence.jdbc.common.impl.BaseJdbcStore<K,V,C>
- All Implemented Interfaces:
org.infinispan.persistence.spi.NonBlockingStore<K,V>
public abstract class BaseJdbcStore<K,V,C extends AbstractJdbcStoreConfiguration>
extends Object
implements org.infinispan.persistence.spi.NonBlockingStore<K,V>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.persistence.spi.NonBlockingStore
org.infinispan.persistence.spi.NonBlockingStore.Characteristic, org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<Type extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.infinispan.util.concurrent.BlockingManagerprotected Cprotected ConnectionFactoryprotected static final Logprotected TableOperations<K,V> protected final Map<javax.transaction.Transaction,Connection> Fields inherited from interface org.infinispan.persistence.spi.NonBlockingStore
SIZE_UNAVAILABLE_FUTURE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapproximateSize(org.infinispan.commons.util.IntSet segments) batch(int publisherCount, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<Object>> removePublisher, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<org.infinispan.persistence.spi.MarshallableEntry<K, V>>> writePublisher) Set<org.infinispan.persistence.spi.NonBlockingStore.Characteristic>clear()commit(javax.transaction.Transaction tx) protected abstract TableOperations<K,V> createTableOperations(org.infinispan.persistence.spi.InitializationContext ctx, C config) Extension point to allow for initializing and creating a table operations object.protected voiddestroyTxConnection(javax.transaction.Transaction tx) protected voidMethod to extend to add additional steps when the store is shutting down.protected ConnectiongetTxConnection(javax.transaction.Transaction tx) CompletionStage<org.infinispan.persistence.spi.MarshallableEntry<K,V>> prepareWithModifications(javax.transaction.Transaction tx, int publisherCount, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<Object>> removePublisher, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<org.infinispan.persistence.spi.MarshallableEntry<K, V>>> writePublisher) publishEntries(org.infinispan.commons.util.IntSet segments, Predicate<? super K> filter, boolean includeValues) org.reactivestreams.Publisher<K>publishKeys(org.infinispan.commons.util.IntSet segments, Predicate<? super K> filter) rollback(javax.transaction.Transaction tx) size(org.infinispan.commons.util.IntSet segments) start(org.infinispan.persistence.spi.InitializationContext ctx) stop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.persistence.spi.NonBlockingStore
addSegments, containsKey, destroy, ignoreCommandWithFlags, purgeExpired, removeSegments
-
Field Details
-
log
-
connectionFactory
-
blockingManager
protected org.infinispan.util.concurrent.BlockingManager blockingManager -
config
-
tableOperations
-
transactionConnectionMap
-
-
Constructor Details
-
BaseJdbcStore
public BaseJdbcStore()
-
-
Method Details
-
characteristics
-
createTableOperations
protected abstract TableOperations<K,V> createTableOperations(org.infinispan.persistence.spi.InitializationContext ctx, C config) throws SQLException Extension point to allow for initializing and creating a table operations object. All variables in theBaseJdbcStorewill be initialized except fortableOperationswhen this is invoked.- Parameters:
ctx- store contextconfig- configuration of the store- Returns:
- the table operations to use for future calls
- Throws:
SQLException- if any database exception occurs during creation
-
start
-
extraStopSteps
protected void extraStopSteps()Method to extend to add additional steps when the store is shutting down. This is invoked before theconnectionFactoryis shut down and should not do so. -
stop
-
isAvailable
-
load
public CompletionStage<org.infinispan.persistence.spi.MarshallableEntry<K,V>> load(int segment, Object key) -
write
public CompletionStage<Void> write(int segment, org.infinispan.persistence.spi.MarshallableEntry<? extends K, ? extends V> entry) -
delete
-
clear
-
batch
public CompletionStage<Void> batch(int publisherCount, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<Object>> removePublisher, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<org.infinispan.persistence.spi.MarshallableEntry<K, V>>> writePublisher) -
prepareWithModifications
public CompletionStage<Void> prepareWithModifications(javax.transaction.Transaction tx, int publisherCount, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<Object>> removePublisher, org.reactivestreams.Publisher<org.infinispan.persistence.spi.NonBlockingStore.SegmentedPublisher<org.infinispan.persistence.spi.MarshallableEntry<K, V>>> writePublisher) -
commit
-
rollback
-
getTxConnection
-
destroyTxConnection
protected void destroyTxConnection(javax.transaction.Transaction tx) -
publishEntries
-
publishKeys
-
size
-
approximateSize
-