Class PersistenceUtil

  • public class PersistenceUtil
    extends Object
    Mircea Markus
    • Constructor Detail

      • PersistenceUtil

        public PersistenceUtil()
    • Method Detail

      • 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.
        salws - segmented store containing entries
        segments - segments to count entries from
        count of entries that are in the provided segments
      • loadAndCheckExpiration

        public static <K,​V> MarshallableEntry<K,​V> loadAndCheckExpiration​(org.infinispan.persistence.manager.PersistenceManager persistenceManager,
                                                                                      Object key,
                                                                                      InvocationContext context,
                                                                                      TimeService timeService)
        since 9.4 This method references PersistenceManager, which isn't a public class
      • 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
        segments - segments to parallelize across
        executor - the executor execute parallelized operations on
        publisherFunction - function that creates a different publisher for each segment
        a publisher that
      • sanitizedCacheName

        public static String sanitizedCacheName​(String cacheName)
        Replace unwanted characters from cache names so they can be used as filenames
      • validateGlobalStateStoreLocation

        public static void validateGlobalStateStoreLocation​(GlobalConfiguration globalConfiguration,
                                                            String storeType,
                                                            Attribute<?>... attributes)