Class PersistenceUtil


  • public class PersistenceUtil
    extends java.lang.Object
    Since:
    6.0
    Author:
    Mircea Markus
    • Constructor Detail

      • PersistenceUtil

        public PersistenceUtil()
    • Method Detail

      • count

        public static <K,​V> int count​(AdvancedCacheLoader<K,​V> acl,
                                            java.util.function.Predicate<? super K> filter)
      • count

        public static int count​(SegmentedAdvancedLoadWriteStore<?,​?> salws,
                                IntSet segments)
        Counts how many entries are present in the segmented store. Only the segments provided will have entries counted.
        Parameters:
        salws - segmented store containing entries
        segments - segments to count entries from
        Returns:
        count of entries that are in the provided segments
      • toKeySet

        public static <K,​V> java.util.Set<K> toKeySet​(AdvancedCacheLoader<K,​V> acl,
                                                            java.util.function.Predicate<? super K> filter)
      • toEntrySet

        public static <K,​V> java.util.Set<InternalCacheEntry<K,​V>> toEntrySet​(AdvancedCacheLoader<K,​V> acl,
                                                                                          java.util.function.Predicate<? super K> filter,
                                                                                          org.infinispan.container.impl.InternalEntryFactory ief)
      • getExpiryTime

        public static long getExpiryTime​(InternalMetadata internalMetadata)
      • loadAndStoreInDataContainer

        @Deprecated
        public static <K,​V> InternalCacheEntry<K,​V> loadAndStoreInDataContainer​(DataContainer<K,​V> dataContainer,
                                                                                            PersistenceManager persistenceManager,
                                                                                            K key,
                                                                                            InvocationContext ctx,
                                                                                            TimeService timeService,
                                                                                            java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> isLoaded)
        Deprecated.
        since 9.4 This method references PersistenceManager, which isn't a public class
      • loadAndStoreInDataContainer

        @Deprecated
        public static <K,​V> InternalCacheEntry<K,​V> loadAndStoreInDataContainer​(DataContainer<K,​V> dataContainer,
                                                                                            int segment,
                                                                                            PersistenceManager persistenceManager,
                                                                                            K key,
                                                                                            InvocationContext ctx,
                                                                                            TimeService timeService,
                                                                                            java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> isLoaded)
        Deprecated.
        since 9.4 This method references PersistenceManager, which isn't a public class
      • loadAndCheckExpiration

        @Deprecated
        public static <K,​V> MarshalledEntry<K,​V> loadAndCheckExpiration​(PersistenceManager persistenceManager,
                                                                                    java.lang.Object key,
                                                                                    InvocationContext context,
                                                                                    TimeService timeService)
        Deprecated.
        since 9.4 This method references PersistenceManager, which isn't a public class
      • convert

        public static <K,​V> InternalCacheEntry<K,​V> convert​(MarshalledEntry<K,​V> loaded,
                                                                        org.infinispan.container.impl.InternalEntryFactory factory)
      • parallelizePublisher

        public static <R> org.reactivestreams.Publisher<R> parallelizePublisher​(IntSet segments,
                                                                                java.util.concurrent.Executor executor,
                                                                                java.util.function.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 across
        executor - the executor execute parallelized operations on
        publisherFunction - function that creates a different publisher for each segment
        Returns:
        a publisher that