Package org.infinispan.persistence
Class PersistenceUtil
java.lang.Object
org.infinispan.persistence.PersistenceUtil
- Since:
- 6.0
- Author:
- Mircea Markus
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> InternalCacheEntry <K, V> convert
(MarshallableEntry<K, V> loaded, InternalEntryFactory factory) static <K,
V> int count
(AdvancedCacheLoader<K, V> acl, Predicate<? super K> filter) static int
count
(SegmentedAdvancedLoadWriteStore<?, ?> salws, IntSet segments) Counts how many entries are present in the segmented store.static Path
getLocation
(GlobalConfiguration globalConfiguration, String location) static Path
getQualifiedLocation
(GlobalConfiguration globalConfiguration, String location, String cacheName, String qualifier) static <R> org.reactivestreams.Publisher
<R> parallelizePublisher
(IntSet segments, Executor executor, IntFunction<org.reactivestreams.Publisher<R>> publisherFunction) Will create a publisher that parallelizes each publisher returned from the publisherFunction by executing them on the executor as needed.static String
sanitizedCacheName
(String cacheName) Replace unwanted characters from cache names so they can be used as filenamesstatic <K,
V> Set <InternalCacheEntry<K, V>> toEntrySet
(AdvancedCacheLoader<K, V> acl, Predicate<? super K> filter, InternalEntryFactory ief) static <K,
V> Set <K> toKeySet
(AdvancedCacheLoader<K, V> acl, Predicate<? super K> filter) static <K,
V> Set <K> toKeySet
(NonBlockingStore<K, V> nonBlockingStore, IntSet segments, Predicate<? super K> filter) static void
validateGlobalStateStoreLocation
(GlobalConfiguration globalConfiguration, String storeType, Attribute<?>... attributes)
-
Constructor Details
-
PersistenceUtil
public PersistenceUtil()
-
-
Method Details
-
count
-
count
Counts how many entries are present in the segmented store. Only the segments provided will have entries counted.- Parameters:
salws
- segmented store containing entriessegments
- segments to count entries from- Returns:
- count of entries that are in the provided segments
-
toKeySet
public static <K,V> Set<K> toKeySet(NonBlockingStore<K, V> nonBlockingStore, IntSet segments, Predicate<? super K> filter) -
toKeySet
-
toEntrySet
public static <K,V> Set<InternalCacheEntry<K,V>> toEntrySet(AdvancedCacheLoader<K, V> acl, Predicate<? super K> filter, InternalEntryFactory ief) -
convert
public static <K,V> InternalCacheEntry<K,V> convert(MarshallableEntry<K, V> loaded, InternalEntryFactory factory) -
parallelizePublisher
public static <R> org.reactivestreams.Publisher<R> parallelizePublisher(IntSet segments, Executor executor, IntFunction<org.reactivestreams.Publisher<R>> publisherFunction) Will create a publisher that parallelizes each publisher returned from the publisherFunction by executing them on the executor as needed.Note that returned publisher will be publishing entries from the invocation of the executor. Thus any subscription will not block the thread it was invoked on, unless explicitly configured to do so.
- Type Parameters:
R
- the returned value- Parameters:
segments
- segments to parallelize acrossexecutor
- the executor execute parallelized operations onpublisherFunction
- function that creates a different publisher for each segment- Returns:
- a publisher that
-
sanitizedCacheName
Replace unwanted characters from cache names so they can be used as filenames -
getQualifiedLocation
public static Path getQualifiedLocation(GlobalConfiguration globalConfiguration, String location, String cacheName, String qualifier) -
getLocation
-
validateGlobalStateStoreLocation
public static void validateGlobalStateStoreLocation(GlobalConfiguration globalConfiguration, String storeType, Attribute<?>... attributes)
-