Skip to content

Commit 298badf

Browse files
resolved comments
1 parent f1fcdcb commit 298badf

7 files changed

Lines changed: 24 additions & 13 deletions

File tree

cloudsql-mysql-plugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<dependency>
6060
<groupId>io.cdap.cdap</groupId>
6161
<artifactId>cdap-data-pipeline2_2.11</artifactId>
62+
<scope>test</scope>
6263
</dependency>
6364
<dependency>
6465
<groupId>junit</groupId>

cloudsql-mysql-plugin/src/main/java/io/cdap/plugin/cloudsql/mysql/CloudSQLMySQLConnectorConfig.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
*/
3030
public class CloudSQLMySQLConnectorConfig extends AbstractDBConnectorConfig {
3131

32-
private static final String JDBC_PROPERTY_CONNECT_TIMEOUT = "connectTimeout";
33-
private static final String JDBC_PROPERTY_SOCKET_TIMEOUT = "socketTimeout";
32+
private static final String JDBC_PROPERTY_CONNECT_TIMEOUT_MILLIS = "connectTimeout";
33+
private static final String JDBC_PROPERTY_SOCKET_TIMEOUT_MILLIS = "socketTimeout";
3434

3535
@Name(CloudSQLMySQLConstants.CONNECTION_NAME)
3636
@Description(
@@ -89,9 +89,8 @@ public String getConnectionString() {
8989
@Override
9090
public Properties getConnectionArgumentsProperties() {
9191
Properties properties = super.getConnectionArgumentsProperties();
92-
// the unit below is milli-second
93-
properties.put(JDBC_PROPERTY_CONNECT_TIMEOUT, "20000");
94-
properties.put(JDBC_PROPERTY_SOCKET_TIMEOUT, "20000");
92+
properties.put(JDBC_PROPERTY_CONNECT_TIMEOUT_MILLIS, "20000");
93+
properties.put(JDBC_PROPERTY_SOCKET_TIMEOUT_MILLIS, "20000");
9594
return properties;
9695
}
9796
}

cloudsql-mysql-plugin/src/main/java/io/cdap/plugin/cloudsql/mysql/CloudSQLMySQLSink.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public Map<String, String> getDBSpecificArguments() {
107107
}
108108

109109
@Override
110+
@Nullable
110111
protected CloudSQLMySQLConnectorConfig getConnection() {
111112
return connection;
112113
}

cloudsql-mysql-plugin/src/test/java/io/cdap/plugin/cloudsql/mysql/CloudSQLMySQLConnectorTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ public static void doSetup() {
5151

5252
@Test
5353
public void test() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
54-
test(new CloudSQLMySQLConnector(
55-
new CloudSQLMySQLConnectorConfig(username, password, JDBC_PLUGIN_NAME, connectionArguments, instanceType,
56-
connectionName, database)), JDBC_DRIVER_CLASS_NAME,
57-
CloudSQLMySQLConstants.PLUGIN_NAME);
54+
test(
55+
new CloudSQLMySQLConnector(
56+
new CloudSQLMySQLConnectorConfig(username, password, JDBC_PLUGIN_NAME, connectionArguments, instanceType,
57+
connectionName, database)
58+
),
59+
JDBC_DRIVER_CLASS_NAME,
60+
CloudSQLMySQLConstants.PLUGIN_NAME
61+
);
5862
}
5963
}

cloudsql-postgresql-plugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
<dependency>
6969
<groupId>io.cdap.cdap</groupId>
7070
<artifactId>cdap-data-pipeline2_2.11</artifactId>
71+
<scope>test</scope>
7172
</dependency>
7273
<dependency>
7374
<groupId>junit</groupId>

cloudsql-postgresql-plugin/src/main/java/io/cdap/plugin/cloudsql/postgres/CloudSQLPostgreSQLSink.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public Map<String, String> getDBSpecificArguments() {
147147
}
148148

149149
@Override
150+
@Nullable
150151
protected CloudSQLPostgreSQLConnectorConfig getConnection() {
151152
return connection;
152153
}

cloudsql-postgresql-plugin/src/test/java/io/cdap/plugin/cloudsql/postgres/CloudSQLPostgreSQLConnectorTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ public static void doSetup() {
5151

5252
@Test
5353
public void test() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
54-
test(new CloudSQLPostgreSQLConnector(
55-
new CloudSQLPostgreSQLConnectorConfig(username, password, JDBC_PLUGIN_NAME, connectionArguments,
56-
instanceType, connectionName, database)), JDBC_DRIVER_CLASS_NAME,
57-
CloudSQLPostgreSQLConstants.PLUGIN_NAME);
54+
test(
55+
new CloudSQLPostgreSQLConnector(
56+
new CloudSQLPostgreSQLConnectorConfig(username, password, JDBC_PLUGIN_NAME, connectionArguments, instanceType,
57+
connectionName, database)
58+
),
59+
JDBC_DRIVER_CLASS_NAME,
60+
CloudSQLPostgreSQLConstants.PLUGIN_NAME
61+
);
5862
}
5963
}

0 commit comments

Comments
 (0)