Package com.google.cloud.spanner.watcher
Interface SpannerTableChangeWatcher
-
- All Superinterfaces:
com.google.api.core.ApiService
- All Known Implementing Classes:
SpannerTableTailer
public interface SpannerTableChangeWatcher extends com.google.api.core.ApiServiceInterface for capturing changes to a single Spanner table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSpannerTableChangeWatcher.RowRow is passed in to the change callback and allows access to the most recent data.static interfaceSpannerTableChangeWatcher.RowChangeCallbackInterface for receiving asynchronous callbacks when a row has been inserted or updated.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCallback(SpannerTableChangeWatcher.RowChangeCallback callback)Adds aSpannerTableChangeWatcher.RowChangeCallbackfor thisSpannerTableChangeWatcher.TableIdgetTable()Returns the id of the table that is monitored by this watcher.
-
-
-
Method Detail
-
getTable
TableId getTable()
Returns the id of the table that is monitored by this watcher.
-
addCallback
void addCallback(SpannerTableChangeWatcher.RowChangeCallback callback)
Adds aSpannerTableChangeWatcher.RowChangeCallbackfor thisSpannerTableChangeWatcher. Callbacks may only be added when theApiService.state()of thisSpannerTableChangeWatcherisApiService.State.NEW. Callbacks should be lightweight and non-blocking. The callback should hand off any heavy computations or blocking operations to a non-blocking executor or buffer.The
SpannerTableChangeWatcherguarantees that at most oneSpannerTableChangeWatcher.RowChangeCallbackwill be active at any given time, and all callbacks will receive all changes in order of commit timestamp. There is no guarantee as to the order of which callback is called first if aSpannerTableChangeWatcherhas registered multiple callbacks.
-
-