Class Connection
java.lang.Object
io.debezium.connector.spanner.util.Connection
-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.google.cloud.spanner.DatabaseClientprivate final Stringprivate final com.google.cloud.spanner.Dialectstatic final Stringprivate final Stringprivate static final org.slf4j.Loggerprivate final Stringprivate io.debezium.connector.spanner.db.dao.SchemaDaoprivate com.google.cloud.spanner.Spanner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect(com.google.cloud.spanner.Dialect dialect) voidcreateChangeStream(String changeStreamName, String... tables) voidcreateChangeStreamNewRow(String changeStreamName, String... tables) voidcreateChangeStreamNewValue(String changeStreamName, String... tables) voidcreateDatabase(String databaseId, com.google.cloud.spanner.Dialect dialect) private StringvoidcreateTable(String tableDefinition) booleandropChangeStream(String changeStreamName) voiddropDatabase(String databaseId) booleancom.google.cloud.spanner.ResultSetexecuteSelect(com.google.cloud.spanner.Statement statement) com.google.cloud.spanner.ResultSetexecuteSelect(String query) executeUpdate(String query) executeUpdate(List<String> queries) private voidinit()booleanisChangeStreamExist(String changeStreamName) booleanisDatabaseExist(String databaseId) private booleanisStreamExist(String streamName) booleanisTableExist(String tableName) void
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
projectId
-
instanceId
-
databaseId
-
emulatorHost
- See Also:
-
databaseClient
public com.google.cloud.spanner.DatabaseClient databaseClient -
spanner
private com.google.cloud.spanner.Spanner spanner -
schemaDao
private io.debezium.connector.spanner.db.dao.SchemaDao schemaDao -
dialect
private final com.google.cloud.spanner.Dialect dialect
-
-
Constructor Details
-
Connection
-
-
Method Details
-
executeSelect
-
executeSelect
public com.google.cloud.spanner.ResultSet executeSelect(com.google.cloud.spanner.Statement statement) -
executeUpdate
-
executeUpdate
-
updateDDL
-
createTable
-
createChangeStream
public void createChangeStream(String changeStreamName, String... tables) throws ExecutionException, InterruptedException -
createChangeStreamNewValue
public void createChangeStreamNewValue(String changeStreamName, String... tables) throws ExecutionException, InterruptedException -
createChangeStreamNewRow
public void createChangeStreamNewRow(String changeStreamName, String... tables) throws ExecutionException, InterruptedException -
createInstance
-
isStreamExist
-
dropTable
- Throws:
InterruptedException
-
dropChangeStream
- Throws:
InterruptedException
-
isChangeStreamExist
-
isTableExist
-
isDatabaseExist
-
dropDatabase
-
createDatabase
public void createDatabase(String databaseId, com.google.cloud.spanner.Dialect dialect) throws InterruptedException - Throws:
InterruptedException
-
connect
- Throws:
InterruptedException
-
init
private void init()
-