Class StreamUtil
java.lang.Object
org.apache.polaris.persistence.nosql.api.StreamUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <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 thebucketFetcherfunction, eventually yielding a stream the elements of all buckets.
-
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 thebucketFetcherfunction, eventually yielding a stream the elements of all buckets.A classic use case for this function is
Persistence.bucketizedBulkFetches(Stream, Class).
-