Skip to content

Commit

Permalink
Fix source/sink creation to use JSON config values. (apache#3922)
Browse files Browse the repository at this point in the history
  • Loading branch information
murong00 authored and merlimat committed Mar 28, 2019
1 parent 012b818 commit ee395ca
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void processArguments() throws Exception {
}

protected Map<String, Object> parseConfigs(String str) {
Type type = new TypeToken<Map<String, String>>(){}.getType();
Type type = new TypeToken<Map<String, Object>>(){}.getType();
return new Gson().fromJson(str, type);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,7 @@ void processArguments() throws Exception {
}

protected Map<String, Object> parseConfigs(String str) {
Type type = new TypeToken<Map<String, String>>() {
}.getType();
Type type = new TypeToken<Map<String, Object>>(){}.getType();
return new Gson().fromJson(str, type);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public void testCliOverwriteConfigFile() throws Exception {
testSinkConfig.setParallelism(PARALLELISM + 1);
testSinkConfig.setArchive(JAR_FILE_PATH + "-prime");
testSinkConfig.setResources(new Resources(CPU + 1, RAM + 1, DISK + 1));
testSinkConfig.setConfigs(createSink.parseConfigs("{\"created_at-prime\":\"Mon Jul 02 00:33:15 +0000 2018\"}"));
testSinkConfig.setConfigs(createSink.parseConfigs("{\"created_at-prime\":\"Mon Jul 02 00:33:15 +0000 2018\", \"otherConfigProperties\":{\"property1.value\":\"value1\",\"property2.value\":\"value2\"}}"));


SinkConfig expectedSinkConfig = getSinkConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public void testCliOverwriteConfigFile() throws Exception {
testSourceConfig.setParallelism(PARALLELISM + 1);
testSourceConfig.setArchive(JAR_FILE_PATH + "-prime");
testSourceConfig.setResources(new Resources(CPU + 1, RAM + 1, DISK + 1));
testSourceConfig.setConfigs(createSource.parseConfigs("{\"created_at-prime\":\"Mon Jul 02 00:33:15 +0000 2018\"}"));
testSourceConfig.setConfigs(createSource.parseConfigs("{\"created_at-prime\":\"Mon Jul 02 00:33:15 +0000 2018\", \"otherProperties\":{\"property1.value\":\"value1\",\"property2.value\":\"value2\"}}"));


SourceConfig expectedSourceConfig = getSourceConfig();
Expand Down

0 comments on commit ee395ca

Please sign in to comment.