Class SqlSnapshots


  • public final class SqlSnapshots
    extends java.lang.Object
    Utilities for loading SQL snapshots.

    For DomainBase and DomainHistory, this class assumes the presence of the bulk-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 of DomainBase 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 given sqlEntityTypes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 given sqlEntityTypes.

        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 of DomainBase and assembles them in the pipeline.
        See Also:
        BulkQueryEntities