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 @@ -318,17 +318,21 @@ class Suite implements GroovyInterceptable {
}
}

String get_ccr_body(String table) {
String get_ccr_body(String table, String db = null) {
if (db == null) {
db = context.dbName
}

Gson gson = new Gson()

Map<String, String> srcSpec = context.getSrcSpec()
Map<String, String> srcSpec = context.getSrcSpec(db)
srcSpec.put("table", table)

Map<String, String> destSpec = context.getDestSpec()
Map<String, String> destSpec = context.getDestSpec(db)
destSpec.put("table", table)

Map<String, Object> body = Maps.newHashMap()
body.put("name", context.suiteName + "_" + context.dbName + "_" + table)
body.put("name", context.suiteName + "_" + db + "_" + table)
body.put("src", srcSpec)
body.put("dest", destSpec)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,26 @@ class SuiteContext implements Closeable {
return spec
}

Map<String, String> getSrcSpec() {
Map<String, String> getSrcSpec(String db = null) {
if (db == null) {
db = dbName
}
String[] jdbc = getJdbcNetInfo().split(":")
Map<String, String> spec = getSpec(jdbc)
spec.put("thrift_port", config.feSourceThriftNetworkAddress.port.toString())
spec.put("database", dbName)
spec.put("database", db)

return spec
}

Map<String, String> getDestSpec() {
Map<String, String> getDestSpec(String db = null) {
if (db == null) {
db = dbName
}
String[] jdbc = getDownstreamJdbcNetInfo().split(":")
Map<String, String> spec = getSpec(jdbc)
spec.put("thrift_port", config.feTargetThriftNetworkAddress.port.toString())
spec.put("database", "TEST_" + dbName)
spec.put("database", "TEST_" + db)

return spec
}
Expand Down