Class DaoFactory
java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.dao.DaoFactory
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionDaoFactory(SpannerConfig changeStreamSpannerConfig, String changeStreamName, List<String> tvfNameList, SpannerConfig metadataSpannerConfig, PartitionMetadataTableNames partitionMetadataTableNames, com.google.cloud.spanner.Options.RpcPriority rpcPriority, String jobName, com.google.cloud.spanner.Dialect spannerChangeStreamDatabaseDialect, com.google.cloud.spanner.Dialect metadataDatabaseDialect, boolean isMutableChangeStream) Constructs aDaoFactorywith the configuration to be used for the underlying instances. -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a singleton DAO instance for querying a partition change stream.Creates and returns a singleton DAO instance for admin operations over the partition metadata table.Creates and returns a singleton DAO instance for accessing the partition metadata table.Returns the tvf name list.boolean
-
Constructor Details
-
DaoFactory
public DaoFactory(SpannerConfig changeStreamSpannerConfig, String changeStreamName, List<String> tvfNameList, SpannerConfig metadataSpannerConfig, PartitionMetadataTableNames partitionMetadataTableNames, com.google.cloud.spanner.Options.RpcPriority rpcPriority, String jobName, com.google.cloud.spanner.Dialect spannerChangeStreamDatabaseDialect, com.google.cloud.spanner.Dialect metadataDatabaseDialect, boolean isMutableChangeStream) Constructs aDaoFactorywith 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 DAOtvfNameList- the list of TVF names specified to query and unionmetadataSpannerConfig- the metadata tables configurationpartitionMetadataTableNames- the names of the partition metadata ddl objectsrpcPriority- the priority of the requests made by the DAO queriesjobName- the name of the running job
-
-
Method Details
-
getTvfNameList
Returns the tvf name list. -
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
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
Creates and returns a singleton DAO instance for querying a partition change stream.This method is thread safe.
- Returns:
- singleton instance of the
ChangeStreamDao
-
isMutableChangeStream
public boolean isMutableChangeStream()
-