Class StreamUtil

java.lang.Object
org.apache.polaris.persistence.nosql.api.StreamUtil

public final class StreamUtil extends Object
  • Constructor Details

    • StreamUtil

      public StreamUtil()
  • Method Details

    • bucketized

      public static <S, R> Stream<R> bucketized(Stream<S> source, Function<List<S>,List<R>> bucketFetcher, int bucketSize)
      Bucketizes the elements of the source stream, passes each bucket through the bucketFetcher function, eventually yielding a stream the elements of all buckets.

      A classic use case for this function is Persistence.bucketizedBulkFetches(Stream, Class).