Package com.google.cloud.spanner.watcher
Interface SpannerDatabaseChangeWatcher
-
- All Superinterfaces:
com.google.api.core.ApiService
- All Known Implementing Classes:
SpannerDatabaseTailer
public interface SpannerDatabaseChangeWatcher extends com.google.api.core.ApiServiceInterface for capturing changes to a set of tables in a Spanner database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCallback(SpannerTableChangeWatcher.RowChangeCallback callback)Adds aSpannerTableChangeWatcher.RowChangeCallbackfor thisSpannerDatabaseChangeWatcher.com.google.cloud.spanner.DatabaseIdgetDatabaseId()Returns the id of the database that is being monitored for changes.Collection<TableId>getTables()Returns the ids of the tables that are monitored by this watcher.
-
-
-
Method Detail
-
getDatabaseId
com.google.cloud.spanner.DatabaseId getDatabaseId()
Returns the id of the database that is being monitored for changes.
-
getTables
Collection<TableId> getTables()
Returns the ids of the tables that are monitored by this watcher. This call can require theSpannerDatabaseChangeWatcherto make a round-trip to the database to determine the actual tables that are being monitored.
-
addCallback
void addCallback(SpannerTableChangeWatcher.RowChangeCallback callback)
Adds aSpannerTableChangeWatcher.RowChangeCallbackfor thisSpannerDatabaseChangeWatcher. Callbacks may only be added when theApiService.state()of thisSpannerDatabaseChangeWatcherisApiService.State.NEW. Callbacks for one table will always be in order of commit timestamp, and only one callback will be active at any time for a table. Callbacks for different tables may be called in parallel, and there is no guarantee to the ordering of callbacks over multiple tables.
-
-