Package com.google.cloud.spanner.watcher
Class SpannerUtils
- java.lang.Object
-
- com.google.cloud.spanner.watcher.SpannerUtils
-
@InternalApi("Public visibility for re-use by other spanner-change-watcher libraries. API-breaking changes without prior notice is possible.") public class SpannerUtils extends ObjectUtils for getting commonly needed schema information from a Spanner database.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpannerUtils.LogRecordBuilder
-
Field Summary
Fields Modifier and Type Field Description static StringFIND_COMMIT_TIMESTAMP_COLUMN_QUERYQuery for getting the column of a table that holds the commit timestamp.
-
Constructor Summary
Constructors Constructor Description SpannerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.cloud.spanner.KeybuildKey(Iterable<String> pkColumns, com.google.cloud.spanner.ResultSet rs)Creates aKeyinstance from anIterableof primary key columns and aResultSetcontaining the data to use for the key.static com.google.api.core.ApiFuture<com.google.common.collect.ImmutableList<String>>getPrimaryKeyColumns(com.google.cloud.spanner.DatabaseClient client, TableId table)Returns the primary key columns of a table.static com.google.api.core.ApiFuture<String>getTimestampColumn(com.google.cloud.spanner.DatabaseClient client, TableId table)Returns the name of the commit timestamp column of the given table.
-
-
-
Field Detail
-
FIND_COMMIT_TIMESTAMP_COLUMN_QUERY
public static final String FIND_COMMIT_TIMESTAMP_COLUMN_QUERY
Query for getting the column of a table that holds the commit timestamp.- See Also:
- Constant Field Values
-
-
Method Detail
-
getTimestampColumn
@InternalApi public static com.google.api.core.ApiFuture<String> getTimestampColumn(com.google.cloud.spanner.DatabaseClient client, TableId table)
Returns the name of the commit timestamp column of the given table.
-
getPrimaryKeyColumns
@InternalApi public static com.google.api.core.ApiFuture<com.google.common.collect.ImmutableList<String>> getPrimaryKeyColumns(com.google.cloud.spanner.DatabaseClient client, TableId table)
Returns the primary key columns of a table.
-
-