public static interface SpannerDatabaseTailer.Builder
SpannerDatabaseTailer.SpannerDatabaseTailer.Builder setCommitTimestampRepository(CommitTimestampRepository repository)
CommitTimestampRepository to use for the SpannerDatabaseTailer.
The default will use a SpannerCommitTimestampRepository which stores the last seen
commit timestamp in a table named LAST_SEEN_COMMIT_TIMESTAMPS in the Spanner database that
this SpannerDatabaseTailer is monitoring. The table will be created if it does not
already exist.
SpannerDatabaseTailer.Builder setShardProvider(ShardProvider shardProvider)
ShardProvider that this SpannerDatabaseTailer should use for all
tables that do not have a specific ShardProvider set through setShardProviders(Map).SpannerDatabaseTailer.Builder setShardProviders(Map<TableId,ShardProvider> shardProviders)
ShardProviders to use for specific tables. Any ShardProvider that is
supplied through this method will override any global ShardProvider that has been set
using setShardProvider(ShardProvider).SpannerDatabaseTailer.Builder setPollInterval(org.threeten.bp.Duration interval)
SpannerDatabaseTailer. The default is 1
second.SpannerDatabaseTailer.Builder setExecutor(ScheduledExecutorService executor)
ScheduledExecutorService to use for this SpannerDatabaseTailer. This executor will be used to execute the poll queries on the tables
and to call the SpannerTableChangeWatcher.RowChangeCallbacks. The default will use a ScheduledThreadPoolExecutor with a core size equal to the number of tables that is being
monitored.SpannerDatabaseTailer.Builder setCommitTimestampColumnFunction(Function<TableId,String> commitTimestampFunction)
Sets a function that returns the commit timestamp column to use for a specific table. This
is only needed in case your tables contain more than one commit timestamp column. SpannerDatabaseTailer can automatically find the commit timestamp column for tables that
only contain one column with allow_commit_timestamp=true.
commitTimestampFunction - The function to use to determine which commit timestamp column
should be used for a specific table. If no function has been specified, or if the
function returns null for a given TableId, the SpannerDatabaseTailer will automatically use the first column of the table that has the
option allow_commit_timestamp=true.SpannerDatabaseTailer build()
SpannerDatabaseTailer from this builder.Copyright © 2022 Google LLC. All rights reserved.