Class PassivationPersistenceManager
- java.lang.Object
-
- org.infinispan.persistence.support.DelegatingPersistenceManager
-
- org.infinispan.persistence.manager.PassivationPersistenceManager
-
- All Implemented Interfaces:
Lifecycle
,PersistenceManager
public class PassivationPersistenceManager extends DelegatingPersistenceManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.persistence.manager.PersistenceManager
PersistenceManager.AccessMode
-
-
Field Summary
-
Fields inherited from class org.infinispan.persistence.support.DelegatingPersistenceManager
componentRegistry, persistenceManager
-
-
Constructor Summary
Constructors Constructor Description PassivationPersistenceManager(PersistenceManager persistenceManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
java.util.concurrent.CompletionStage<MarshallableEntry<K,V>>loadFromAllStores(java.lang.Object key, boolean localInvocation, boolean includeStores)
Loads an entry from the persistence store for the given key.<K,V>
java.util.concurrent.CompletionStage<MarshallableEntry<K,V>>loadFromAllStores(java.lang.Object key, int segment, boolean localInvocation, boolean includeStores)
Same asPersistenceManager.loadFromAllStores(Object, boolean, boolean)
except that the segment of the key is also provided to avoid having to calculate the segment.java.util.concurrent.CompletionStage<java.lang.Void>
passivate(MarshallableEntry marshallableEntry, int segment)
int
pendingPassivations()
<K,V>
org.reactivestreams.Publisher<MarshallableEntry<K,V>>publishEntries(boolean fetchValue, boolean fetchMetadata)
<K,V>
org.reactivestreams.Publisher<MarshallableEntry<K,V>>publishEntries(java.util.function.Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata, java.util.function.Predicate<? super StoreConfiguration> predicate)
Returns a publisher that will publish all entries stored by the underlying cache store.<K,V>
org.reactivestreams.Publisher<MarshallableEntry<K,V>>publishEntries(IntSet segments, java.util.function.Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata, java.util.function.Predicate<? super StoreConfiguration> predicate)
Returns a publisher that will publish entries that map to the provided segments.<K> org.reactivestreams.Publisher<K>
publishKeys(java.util.function.Predicate<? super K> filter, java.util.function.Predicate<? super StoreConfiguration> predicate)
Returns a publisher that will publish all keys stored by the underlying cache store.<K> org.reactivestreams.Publisher<K>
publishKeys(IntSet segments, java.util.function.Predicate<? super K> filter, java.util.function.Predicate<? super StoreConfiguration> predicate)
Returns a publisher that will publish keys that map to the provided segments.java.util.concurrent.CompletionStage<java.lang.Integer>
size(java.util.function.Predicate<? super StoreConfiguration> predicate)
Returns the count of how many entries are persisted.-
Methods inherited from class org.infinispan.persistence.support.DelegatingPersistenceManager
addSegments, clearAllStores, commitAllTxStores, deleteBatchFromAllNonTxStores, deleteFromAllStores, deleteFromAllStoresSync, disableStore, getActual, getStores, getStoresAsString, hasWriter, isAvailable, isEnabled, isPreloaded, isReadOnly, loadFromAllStoresSync, loadFromAllStoresSync, preload, prepareAllTxStores, purgeExpired, removeSegments, rollbackAllTxStores, setClearOnStop, size, size, start, stop, writeBatchToAllNonTxStores, writeToAllNonTxStores, writeToAllNonTxStores, writeToAllNonTxStoresSync
-
-
-
-
Constructor Detail
-
PassivationPersistenceManager
public PassivationPersistenceManager(PersistenceManager persistenceManager)
-
-
Method Detail
-
passivate
public java.util.concurrent.CompletionStage<java.lang.Void> passivate(MarshallableEntry marshallableEntry, int segment)
-
loadFromAllStores
public <K,V> java.util.concurrent.CompletionStage<MarshallableEntry<K,V>> loadFromAllStores(java.lang.Object key, int segment, boolean localInvocation, boolean includeStores)
Description copied from interface:PersistenceManager
Same asPersistenceManager.loadFromAllStores(Object, boolean, boolean)
except that the segment of the key is also provided to avoid having to calculate the segment.- Specified by:
loadFromAllStores
in interfacePersistenceManager
- Overrides:
loadFromAllStores
in classDelegatingPersistenceManager
- Parameters:
key
- key to read the entry fromsegment
- segment the key maps tolocalInvocation
- whether this invocation is a local invocation. Some loaders may be ignored if it is not localincludeStores
- if a loader that is also a store can be loaded from- Returns:
- entry that maps to the key
-
loadFromAllStores
public <K,V> java.util.concurrent.CompletionStage<MarshallableEntry<K,V>> loadFromAllStores(java.lang.Object key, boolean localInvocation, boolean includeStores)
Description copied from interface:PersistenceManager
Loads an entry from the persistence store for the given key. The returned value may be null. This value is guaranteed to not be expired when it was returned.- Specified by:
loadFromAllStores
in interfacePersistenceManager
- Overrides:
loadFromAllStores
in classDelegatingPersistenceManager
- Parameters:
key
- key to read the entry fromlocalInvocation
- whether this invocation is a local invocation. Some loaders may be ignored if it is not localincludeStores
- if a loader that is also a store can be loaded from- Returns:
- entry that maps to the key
-
publishKeys
public <K> org.reactivestreams.Publisher<K> publishKeys(java.util.function.Predicate<? super K> filter, java.util.function.Predicate<? super StoreConfiguration> predicate)
Description copied from interface:PersistenceManager
Returns a publisher that will publish all keys stored by the underlying cache store. Only the first cache store that implementsAdvancedCacheLoader
will be used. Predicate is applied by the underlying loader in a best attempt to improve performance.This method should be preferred over
PersistenceManager.publishEntries(Predicate, boolean, boolean, Predicate)
when only keys are desired as many stores can do this in a significantly more performant way.This publisher will never return a key which belongs to an expired entry
- Specified by:
publishKeys
in interfacePersistenceManager
- Overrides:
publishKeys
in classDelegatingPersistenceManager
- Type Parameters:
K
- key type- Parameters:
filter
- filter so that only keys which match are returnedpredicate
- access mode to choose what type of loader to use- Returns:
- publisher that will publish keys
-
publishKeys
public <K> org.reactivestreams.Publisher<K> publishKeys(IntSet segments, java.util.function.Predicate<? super K> filter, java.util.function.Predicate<? super StoreConfiguration> predicate)
Description copied from interface:PersistenceManager
Returns a publisher that will publish keys that map to the provided segments. It will attempt to find the first segmented store if one is available. If not it will fall back to the first non segmented store and filter out entries that don't map to the provided segment.This method should be preferred over
PersistenceManager.publishEntries(IntSet, Predicate, boolean, boolean, Predicate)
when only keys are desired as many stores can do this in a significantly more performant way.This publisher will never return a key which belongs to an expired entry
- Specified by:
publishKeys
in interfacePersistenceManager
- Overrides:
publishKeys
in classDelegatingPersistenceManager
- Type Parameters:
K
- key type- Parameters:
segments
- only keys that map to these segments are processedfilter
- filter so that only keys which match are returnedpredicate
- access mode to choose what type of loader to use- Returns:
- publisher that will publish keys belonging to the given segments
-
publishEntries
public <K,V> org.reactivestreams.Publisher<MarshallableEntry<K,V>> publishEntries(boolean fetchValue, boolean fetchMetadata)
Description copied from interface:PersistenceManager
- Specified by:
publishEntries
in interfacePersistenceManager
- Overrides:
publishEntries
in classDelegatingPersistenceManager
-
publishEntries
public <K,V> org.reactivestreams.Publisher<MarshallableEntry<K,V>> publishEntries(java.util.function.Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata, java.util.function.Predicate<? super StoreConfiguration> predicate)
Description copied from interface:PersistenceManager
Returns a publisher that will publish all entries stored by the underlying cache store. Only the first cache store that implementsAdvancedCacheLoader
will be used. Predicate is applied by the underlying loader in a best attempt to improve performance.Caller can tell the store to also fetch the value or metadata. In some cases this can improve performance. If metadata is not fetched the publisher may include expired entries.
- Specified by:
publishEntries
in interfacePersistenceManager
- Overrides:
publishEntries
in classDelegatingPersistenceManager
- Type Parameters:
K
- key typeV
- value type- Parameters:
filter
- filter so that only entries whose key matches are returnedfetchValue
- whether to fetch value or notfetchMetadata
- whether to fetch metadata or notpredicate
- whether a store can be used by publish entries- Returns:
- publisher that will publish entries
-
publishEntries
public <K,V> org.reactivestreams.Publisher<MarshallableEntry<K,V>> publishEntries(IntSet segments, java.util.function.Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata, java.util.function.Predicate<? super StoreConfiguration> predicate)
Description copied from interface:PersistenceManager
Returns a publisher that will publish entries that map to the provided segments. It will attempt to find the first segmented store if one is available. If not it will fall back to the first non segmented store and filter out entries that don't map to the provided segment.- Specified by:
publishEntries
in interfacePersistenceManager
- Overrides:
publishEntries
in classDelegatingPersistenceManager
- Type Parameters:
K
- key typeV
- value type- Parameters:
segments
- only entries that map to these segments are processedfilter
- filter so that only entries whose key matches are returnedfetchValue
- whether to fetch value or notfetchMetadata
- whether to fetch metadata or notpredicate
- whether a store can be used by publish entries- Returns:
- publisher that will publish entries belonging to the given segments
-
size
public java.util.concurrent.CompletionStage<java.lang.Integer> size(java.util.function.Predicate<? super StoreConfiguration> predicate)
Description copied from interface:PersistenceManager
Returns the count of how many entries are persisted. If no store can handle the request for the given mode a value of -1 is returned instead.- Specified by:
size
in interfacePersistenceManager
- Overrides:
size
in classDelegatingPersistenceManager
- Parameters:
predicate
- whether a loader can be used- Returns:
- size or -1 if size couldn't be computed
-
pendingPassivations
public int pendingPassivations()
-
-