Package com.google.cloud.spanner.watcher
Class SpannerTableTailer.Builder
- java.lang.Object
-
- com.google.cloud.spanner.watcher.SpannerTableTailer.Builder
-
- Enclosing class:
- SpannerTableTailer
public static class SpannerTableTailer.Builder extends Object
Builder for aSpannerTableTailer.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpannerTableTailerbuild()Creates theSpannerTableTailer.SpannerTableTailer.BuildersetCommitTimestampColumn(String column)This should only be set if your table contains more than one commit timestamp column.SpannerTableTailer.BuildersetCommitTimestampRepository(CommitTimestampRepository repository)Sets theCommitTimestampRepositoryto use with thisSpannerTableTailer.SpannerTableTailer.BuildersetExecutor(ScheduledExecutorService executor)Sets the executor to use to poll the table and to execute theSpannerTableChangeWatcher.RowChangeCallbacks.SpannerTableTailer.BuildersetPollInterval(org.threeten.bp.Duration interval)Sets the poll interval for the table.SpannerTableTailer.BuildersetShardProvider(ShardProvider provider)Sets theShardProviderthat thisSpannerTableTailershould use.
-
-
-
Method Detail
-
setShardProvider
public SpannerTableTailer.Builder setShardProvider(ShardProvider provider)
Sets theShardProviderthat thisSpannerTableTailershould use.
-
setCommitTimestampRepository
public SpannerTableTailer.Builder setCommitTimestampRepository(CommitTimestampRepository repository)
Sets theCommitTimestampRepositoryto use with thisSpannerTableTailer.If none is set, it will default to a
SpannerCommitTimestampRepositorywhich stores the last seen commit timestamp in a table named LAST_SEEN_COMMIT_TIMESTAMPS. The table will be created if it does not yet exist.
-
setPollInterval
public SpannerTableTailer.Builder setPollInterval(org.threeten.bp.Duration interval)
Sets the poll interval for the table. Defaults to 1 second.
-
setExecutor
public SpannerTableTailer.Builder setExecutor(ScheduledExecutorService executor)
Sets the executor to use to poll the table and to execute theSpannerTableChangeWatcher.RowChangeCallbacks. Defaults to a single daemon threaded executor that is exclusively used for thisSpannerTableTailer.
-
setCommitTimestampColumn
public SpannerTableTailer.Builder setCommitTimestampColumn(String column)
This should only be set if your table contains more than one commit timestamp column.Sets the commit timestamp column to use. It is only necessary to set this property if the table contains more than one column with the allow_commit_timestamp=true option. If the table only contains one column that can hold a commit timestamp, the
SpannerTableTailerwill find the column automatically.
-
build
public SpannerTableTailer build()
Creates theSpannerTableTailer.
-
-