java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.dao.DaoFactory
All Implemented Interfaces:
Serializable

public class DaoFactory extends Object implements Serializable
Factory class to create data access objects to perform change stream queries and access the metadata tables. The instances created are all singletons.
See Also:
  • Constructor Details

    • DaoFactory

      public DaoFactory(SpannerConfig changeStreamSpannerConfig, String changeStreamName, SpannerConfig metadataSpannerConfig, PartitionMetadataTableNames partitionMetadataTableNames, Options.RpcPriority rpcPriority, String jobName, Dialect spannerChangeStreamDatabaseDialect, Dialect metadataDatabaseDialect)
      Constructs a DaoFactory with the configuration to be used for the underlying instances.
      Parameters:
      changeStreamSpannerConfig - the configuration for the change streams DAO
      changeStreamName - the name of the change stream for the change streams DAO
      metadataSpannerConfig - the metadata tables configuration
      partitionMetadataTableNames - the names of the partition metadata ddl objects
      rpcPriority - the priority of the requests made by the DAO queries
      jobName - the name of the running job
  • Method Details

    • getPartitionMetadataAdminDao

      public PartitionMetadataAdminDao getPartitionMetadataAdminDao()
      Creates and returns a singleton DAO instance for admin operations over the partition metadata table.

      This method is thread safe.

      Returns:
      singleton instance of the PartitionMetadataDao
    • getPartitionMetadataDao

      public PartitionMetadataDao getPartitionMetadataDao()
      Creates and returns a singleton DAO instance for accessing the partition metadata table.

      This method is thread safe.

      Returns:
      singleton instance of the PartitionMetadataDao
    • getChangeStreamDao

      public ChangeStreamDao getChangeStreamDao()
      Creates and returns a singleton DAO instance for querying a partition change stream.

      This method is thread safe.

      Returns:
      singleton instance of the ChangeStreamDao