Class BatchedQueries
java.lang.Object
google.registry.persistence.transaction.BatchedQueries
Helper for querying large data sets in batches.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stream
<com.google.common.collect.ImmutableList<T>> loadAllOf
(JpaTransactionManager jpaTm, Class<T> entityType, int batchSize) Loads all entities of typeT
in batches.static <T> Stream
<com.google.common.collect.ImmutableList<T>> static <T> Stream
<com.google.common.collect.ImmutableList<T>>
-
Method Details
-
loadAllOf
-
loadAllOf
-
loadAllOf
public static <T> Stream<com.google.common.collect.ImmutableList<T>> loadAllOf(JpaTransactionManager jpaTm, Class<T> entityType, int batchSize) Loads all entities of typeT
in batches.This method must not be nested in any transaction; same for the traversal of the returned
Stream
. Each batch is loaded in a separate transaction at theTRANSACTION_REPEATABLE_READ
isolation level, and loads the snapshot of the batch at the batch's start time. New insertions or updates since then are not reflected in the result.
-