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
Fields Modifier and Type Field Description protected org.infinispan.util.concurrent.BlockingManagerblockingManagerprotected Cconfigprotected ConnectionFactoryconnectionFactoryprotected static Loglogprotected TableOperations<K,V>tableOperationsprotected Map<Transaction,Connection>transactionConnectionMap
-
Constructor Summary
Constructors Constructor Description BaseJdbcStore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CompletionStage<Long>approximateSize(org.infinispan.commons.util.IntSet segments)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)Set<org.infinispan.persistence.spi.NonBlockingStore.Characteristic>characteristics()CompletionStage<Void>clear()CompletionStage<Void>commit(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.CompletionStage<Boolean>delete(int segment, Object key)protected voiddestroyTxConnection(Transaction tx)protected voidextraStopSteps()Method to extend to add additional steps when the store is shutting down.protected ConnectiongetTxConnection(Transaction tx)CompletionStage<Boolean>isAvailable()CompletionStage<org.infinispan.persistence.spi.MarshallableEntry<K,V>>load(int segment, Object key)CompletionStage<Void>prepareWithModifications(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)org.reactivestreams.Publisher<org.infinispan.persistence.spi.MarshallableEntry<K,V>>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)CompletionStage<Void>rollback(Transaction tx)CompletionStage<Long>size(org.infinispan.commons.util.IntSet segments)CompletionStage<Void>start(org.infinispan.persistence.spi.InitializationContext ctx)CompletionStage<Void>stop()CompletionStage<Void>write(int segment, org.infinispan.persistence.spi.MarshallableEntry<? extends K,? extends V> entry)
-
-
-
Field Detail
-
log
protected static final Log log
-
connectionFactory
protected ConnectionFactory connectionFactory
-
blockingManager
protected org.infinispan.util.concurrent.BlockingManager blockingManager
-
config
protected C extends AbstractJdbcStoreConfiguration config
-
tableOperations
protected TableOperations<K,V> tableOperations
-
transactionConnectionMap
protected final Map<Transaction,Connection> transactionConnectionMap
-
-
Method Detail
-
characteristics
public Set<org.infinispan.persistence.spi.NonBlockingStore.Characteristic> 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
public CompletionStage<Void> start(org.infinispan.persistence.spi.InitializationContext ctx)
-
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
public CompletionStage<Void> stop()
-
isAvailable
public CompletionStage<Boolean> 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
public CompletionStage<Boolean> delete(int segment, Object key)
-
clear
public CompletionStage<Void> 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(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
public CompletionStage<Void> commit(Transaction tx)
-
rollback
public CompletionStage<Void> rollback(Transaction tx)
-
getTxConnection
protected Connection getTxConnection(Transaction tx)
-
destroyTxConnection
protected void destroyTxConnection(Transaction tx)
-
publishEntries
public org.reactivestreams.Publisher<org.infinispan.persistence.spi.MarshallableEntry<K,V>> publishEntries(org.infinispan.commons.util.IntSet segments, Predicate<? super K> filter, boolean includeValues)
-
publishKeys
public org.reactivestreams.Publisher<K> publishKeys(org.infinispan.commons.util.IntSet segments, Predicate<? super K> filter)
-
size
public CompletionStage<Long> size(org.infinispan.commons.util.IntSet segments)
-
approximateSize
public CompletionStage<Long> approximateSize(org.infinispan.commons.util.IntSet segments)
-
-