public class PersistenceUtil extends Object
Constructor and Description |
---|
PersistenceUtil() |
Modifier and Type | Method and Description |
---|---|
static <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 <K,V> MarshallableEntry<K,V> |
loadAndCheckExpiration(PersistenceManager persistenceManager,
Object key,
InvocationContext context,
TimeService timeService)
Deprecated.
since 9.4 This method references PersistenceManager, which isn't a public class
|
static <K,V> InternalCacheEntry<K,V> |
loadAndComputeInDataContainer(DataContainer<K,V> dataContainer,
int segment,
PersistenceManager persistenceManager,
K key,
InvocationContext ctx,
TimeService timeService,
DataContainer.ComputeAction<K,V> action)
Deprecated.
since 9.4 This method references PersistenceManager, which isn't a public class
|
static <K,V> InternalCacheEntry<K,V> |
loadAndStoreInDataContainer(DataContainer<K,V> dataContainer,
int segment,
PersistenceManager persistenceManager,
K key,
InvocationContext ctx,
TimeService timeService,
AtomicReference<Boolean> isLoaded)
Deprecated.
since 9.4 This method references PersistenceManager, which isn't a public class
|
static <K,V> InternalCacheEntry<K,V> |
loadAndStoreInDataContainer(DataContainer<K,V> dataContainer,
PersistenceManager persistenceManager,
K key,
InvocationContext ctx,
TimeService timeService,
AtomicReference<Boolean> isLoaded)
Deprecated.
since 9.4 This method references PersistenceManager, which isn't a public class
|
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 filenames
|
static <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) |
public static <K,V> int count(AdvancedCacheLoader<K,V> acl, Predicate<? super K> filter)
public static int count(SegmentedAdvancedLoadWriteStore<?,?> salws, IntSet segments)
salws
- segmented store containing entriessegments
- segments to count entries frompublic static <K,V> Set<K> toKeySet(NonBlockingStore<K,V> nonBlockingStore, IntSet segments, Predicate<? super K> filter)
public static <K,V> Set<K> toKeySet(AdvancedCacheLoader<K,V> acl, Predicate<? super K> filter)
public static <K,V> Set<InternalCacheEntry<K,V>> toEntrySet(AdvancedCacheLoader<K,V> acl, Predicate<? super K> filter, InternalEntryFactory ief)
@Deprecated public static <K,V> InternalCacheEntry<K,V> loadAndStoreInDataContainer(DataContainer<K,V> dataContainer, PersistenceManager persistenceManager, K key, InvocationContext ctx, TimeService timeService, AtomicReference<Boolean> isLoaded)
@Deprecated public static <K,V> InternalCacheEntry<K,V> loadAndStoreInDataContainer(DataContainer<K,V> dataContainer, int segment, PersistenceManager persistenceManager, K key, InvocationContext ctx, TimeService timeService, AtomicReference<Boolean> isLoaded)
@Deprecated public static <K,V> InternalCacheEntry<K,V> loadAndComputeInDataContainer(DataContainer<K,V> dataContainer, int segment, PersistenceManager persistenceManager, K key, InvocationContext ctx, TimeService timeService, DataContainer.ComputeAction<K,V> action)
@Deprecated public static <K,V> MarshallableEntry<K,V> loadAndCheckExpiration(PersistenceManager persistenceManager, Object key, InvocationContext context, TimeService timeService)
public static <K,V> InternalCacheEntry<K,V> convert(MarshallableEntry<K,V> loaded, InternalEntryFactory factory)
public static <R> org.reactivestreams.Publisher<R> parallelizePublisher(IntSet segments, Executor executor, IntFunction<org.reactivestreams.Publisher<R>> publisherFunction)
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.
R
- the returned valuesegments
- segments to parallelize acrossexecutor
- the executor execute parallelized operations onpublisherFunction
- function that creates a different publisher for each segmentpublic static String sanitizedCacheName(String cacheName)
public static Path getQualifiedLocation(GlobalConfiguration globalConfiguration, String location, String cacheName, String qualifier)
public static Path getLocation(GlobalConfiguration globalConfiguration, String location)
public static void validateGlobalStateStoreLocation(GlobalConfiguration globalConfiguration, String storeType, Attribute<?>... attributes)
Copyright © 2021 JBoss by Red Hat. All rights reserved.