Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -334,19 +334,30 @@ private void writeRowInSpanner() {
spannerResourceManager.write(m);
}

private void assertRowInMySQL() {
private void assertRowInMySQL() throws InterruptedException {
PipelineOperator.Result result =
pipelineOperator()
.waitForCondition(
createConfig(jobInfo, Duration.ofMinutes(15)),
() -> jdbcResourceManager.getRowCount(TABLE) == 1);
/*
* Added to handle updates.
* TODO(khajanchi@), explore if this sleep be replaced with something more definite.
*/
Thread.sleep(Duration.ofMinutes(1L).toMillis());

assertThatResult(result).meetsConditions();

result =
pipelineOperator()
.waitForCondition(
createConfig(jobInfo, Duration.ofMinutes(15)),
() -> jdbcResourceManager.getRowCount(TABLE2) == 2);
/*
* Added to handle updates.
* TODO(khajanchi@), explore if this sleep be replaced with something more definite.
*/
Thread.sleep(Duration.ofMinutes(1L).toMillis());
assertThatResult(result).meetsConditions();

List<Map<String, Object>> rows = jdbcResourceManager.readTable(TABLE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP TABLE IF EXISTS Users1;
DROP TABLE IF EXISTS AllDatatypeTransformation;

CREATE TABLE Users1 (
id INT NOT NULL,
first_name VARCHAR(25),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
CREATE TABLE IF NOT EXISTS Users1 (
DROP TABLE IF EXISTS Users1;
DROP TABLE IF EXISTS AllDatatypeTransformation;

CREATE TABLE Users1 (
id INT64 NOT NULL,
name STRING(25),
) PRIMARY KEY(id);
Expand Down
Loading