Class DaoFactory
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.dao.DaoFactory
-
- All Implemented Interfaces:
java.io.Serializable
public class DaoFactory extends java.lang.Object implements java.io.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DaoFactory(SpannerConfig changeStreamSpannerConfig, java.lang.String changeStreamName, SpannerConfig metadataSpannerConfig, java.lang.String partitionMetadataTableName, com.google.cloud.spanner.Options.RpcPriority rpcPriority, java.lang.String jobName, com.google.cloud.spanner.Dialect spannerChangeStreamDatabaseDialect, com.google.cloud.spanner.Dialect metadataDatabaseDialect)
Constructs aDaoFactory
with the configuration to be used for the underlying instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeStreamDao
getChangeStreamDao()
Creates and returns a singleton DAO instance for querying a partition change stream.PartitionMetadataAdminDao
getPartitionMetadataAdminDao()
Creates and returns a singleton DAO instance for admin operations over the partition metadata table.PartitionMetadataDao
getPartitionMetadataDao()
Creates and returns a singleton DAO instance for accessing the partition metadata table.
-
-
-
Constructor Detail
-
DaoFactory
public DaoFactory(SpannerConfig changeStreamSpannerConfig, java.lang.String changeStreamName, SpannerConfig metadataSpannerConfig, java.lang.String partitionMetadataTableName, com.google.cloud.spanner.Options.RpcPriority rpcPriority, java.lang.String jobName, com.google.cloud.spanner.Dialect spannerChangeStreamDatabaseDialect, com.google.cloud.spanner.Dialect metadataDatabaseDialect)
Constructs aDaoFactory
with the configuration to be used for the underlying instances.- Parameters:
changeStreamSpannerConfig
- the configuration for the change streams DAOchangeStreamName
- the name of the change stream for the change streams DAOmetadataSpannerConfig
- the metadata tables configurationpartitionMetadataTableName
- the name of the created partition metadata tablerpcPriority
- the priority of the requests made by the DAO queriesjobName
- the name of the running job
-
-
Method Detail
-
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
-
-