Package google.registry.beam.comparedb
Class SqlSnapshots
- java.lang.Object
-
- google.registry.beam.comparedb.SqlSnapshots
-
public final class SqlSnapshots extends java.lang.Object
Utilities for loading SQL snapshots.For
DomainBase
andDomainHistory
, this class assumes the presence of thebulk-query-capable JpaTransactionManager
, and takes advantage of it for higher throughput.For now this class is meant for use during the database migration period only. Therefore, it contains optimizations specifically for the production database at the current size, e.g., parallel queries for select tables.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.beam.sdk.values.PCollection<SqlEntity>
loadAndAssembleDomainBase(org.apache.beam.sdk.Pipeline pipeline, java.util.Optional<java.lang.String> snapshotId, java.util.Optional<org.joda.time.DateTime> compareStartTime)
Bulk-loads parts ofDomainBase
and assembles them in the pipeline.static org.apache.beam.sdk.values.PCollectionTuple
loadCloudSqlSnapshotByType(org.apache.beam.sdk.Pipeline pipeline, com.google.common.collect.ImmutableSet<java.lang.Class<? extends SqlEntity>> sqlEntityTypes, java.util.Optional<java.lang.String> snapshotId, java.util.Optional<org.joda.time.DateTime> compareStartTime)
Loads a SQL snapshot for the givensqlEntityTypes
.
-
-
-
Method Detail
-
loadCloudSqlSnapshotByType
public static org.apache.beam.sdk.values.PCollectionTuple loadCloudSqlSnapshotByType(org.apache.beam.sdk.Pipeline pipeline, com.google.common.collect.ImmutableSet<java.lang.Class<? extends SqlEntity>> sqlEntityTypes, java.util.Optional<java.lang.String> snapshotId, java.util.Optional<org.joda.time.DateTime> compareStartTime)
Loads a SQL snapshot for the givensqlEntityTypes
.If
snapshotId
is present, all queries use the specified database snapshot, guaranteeing a consistent result.
-
loadAndAssembleDomainBase
public static org.apache.beam.sdk.values.PCollection<SqlEntity> loadAndAssembleDomainBase(org.apache.beam.sdk.Pipeline pipeline, java.util.Optional<java.lang.String> snapshotId, java.util.Optional<org.joda.time.DateTime> compareStartTime)
Bulk-loads parts ofDomainBase
and assembles them in the pipeline.- See Also:
BulkQueryEntities
-
-