diff --git a/amazon-redshift-plugin/widgets/Redshift-batchsource.json b/amazon-redshift-plugin/widgets/Redshift-batchsource.json
index 943e2d24e..99102177e 100644
--- a/amazon-redshift-plugin/widgets/Redshift-batchsource.json
+++ b/amazon-redshift-plugin/widgets/Redshift-batchsource.json
@@ -156,6 +156,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [
@@ -228,7 +259,7 @@
"name": "connection"
}
]
- },
+ }
],
"jump-config": {
"datasets": [
diff --git a/amazon-redshift-plugin/widgets/Redshift-connector.json b/amazon-redshift-plugin/widgets/Redshift-connector.json
index 3a2af8e01..5b452e54f 100644
--- a/amazon-redshift-plugin/widgets/Redshift-connector.json
+++ b/amazon-redshift-plugin/widgets/Redshift-connector.json
@@ -69,6 +69,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": []
diff --git a/aurora-mysql-plugin/widgets/AuroraMysql-action.json b/aurora-mysql-plugin/widgets/AuroraMysql-action.json
index efc5f98ff..050ee9967 100644
--- a/aurora-mysql-plugin/widgets/AuroraMysql-action.json
+++ b/aurora-mysql-plugin/widgets/AuroraMysql-action.json
@@ -90,6 +90,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
]
}
diff --git a/aurora-mysql-plugin/widgets/AuroraMysql-batchsink.json b/aurora-mysql-plugin/widgets/AuroraMysql-batchsink.json
index a435e4e4f..cd48b44a8 100644
--- a/aurora-mysql-plugin/widgets/AuroraMysql-batchsink.json
+++ b/aurora-mysql-plugin/widgets/AuroraMysql-batchsink.json
@@ -116,6 +116,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [],
diff --git a/aurora-mysql-plugin/widgets/AuroraMysql-batchsource.json b/aurora-mysql-plugin/widgets/AuroraMysql-batchsource.json
index 50b435645..5956c7f39 100644
--- a/aurora-mysql-plugin/widgets/AuroraMysql-batchsource.json
+++ b/aurora-mysql-plugin/widgets/AuroraMysql-batchsource.json
@@ -135,6 +135,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [
diff --git a/aurora-mysql-plugin/widgets/AuroraMysql-postaction.json b/aurora-mysql-plugin/widgets/AuroraMysql-postaction.json
index cc33cf0a1..eac67041e 100644
--- a/aurora-mysql-plugin/widgets/AuroraMysql-postaction.json
+++ b/aurora-mysql-plugin/widgets/AuroraMysql-postaction.json
@@ -105,6 +105,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
]
}
diff --git a/aurora-postgresql-plugin/widgets/AuroraPostgres-action.json b/aurora-postgresql-plugin/widgets/AuroraPostgres-action.json
index 1f3bca862..7057596f8 100644
--- a/aurora-postgresql-plugin/widgets/AuroraPostgres-action.json
+++ b/aurora-postgresql-plugin/widgets/AuroraPostgres-action.json
@@ -79,6 +79,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
]
}
diff --git a/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsink.json b/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsink.json
index 53979d6d4..8b412bf9f 100644
--- a/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsink.json
+++ b/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsink.json
@@ -121,6 +121,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [],
diff --git a/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsource.json b/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsource.json
index 14b00b974..1a614b829 100644
--- a/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsource.json
+++ b/aurora-postgresql-plugin/widgets/AuroraPostgres-batchsource.json
@@ -124,6 +124,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [
diff --git a/aurora-postgresql-plugin/widgets/AuroraPostgres-postaction.json b/aurora-postgresql-plugin/widgets/AuroraPostgres-postaction.json
index 3fdb1a14b..4ea223eb3 100644
--- a/aurora-postgresql-plugin/widgets/AuroraPostgres-postaction.json
+++ b/aurora-postgresql-plugin/widgets/AuroraPostgres-postaction.json
@@ -94,6 +94,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
]
}
diff --git a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-action.json b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-action.json
index 66d6ebb85..6be894957 100644
--- a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-action.json
+++ b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-action.json
@@ -112,6 +112,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"filters": [
diff --git a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsink.json b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsink.json
index 89a7d7736..1c0a88d2c 100644
--- a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsink.json
+++ b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsink.json
@@ -176,6 +176,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"filters": [
diff --git a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsource.json b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsource.json
index 4ac7747f4..18949ec52 100644
--- a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsource.json
+++ b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-batchsource.json
@@ -175,6 +175,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [
diff --git a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-connector.json b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-connector.json
index b5c2c9993..e5dee9e73 100644
--- a/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-connector.json
+++ b/cloudsql-mysql-plugin/widgets/CloudSQLMySQL-connector.json
@@ -94,6 +94,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [],
diff --git a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-action.json b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-action.json
index eab240679..658ba414e 100644
--- a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-action.json
+++ b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-action.json
@@ -112,6 +112,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"filters": [
diff --git a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsink.json b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsink.json
index 2fda594dd..a685b6610 100644
--- a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsink.json
+++ b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsink.json
@@ -192,6 +192,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [],
diff --git a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsource.json b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsource.json
index 96ea97ac2..1584199eb 100644
--- a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsource.json
+++ b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-batchsource.json
@@ -175,6 +175,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [
diff --git a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-connector.json b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-connector.json
index 9824f91bd..c1058b96e 100644
--- a/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-connector.json
+++ b/cloudsql-postgresql-plugin/widgets/CloudSQLPostgreSQL-connector.json
@@ -94,6 +94,37 @@
}
}
]
+ },
+ {
+ "properties": [
+ {
+ "widget-type": "hidden",
+ "label": "Initial Retry Duration (sec)",
+ "name": "initialRetryDuration",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Duration (sec)",
+ "name": "maxRetryDuration",
+ "widget-attributes": {
+ "default": 60,
+ "minimum": 0
+ }
+ },
+ {
+ "widget-type": "hidden",
+ "label": "Maximum Retry Count",
+ "name": "maxRetryCount",
+ "widget-attributes": {
+ "default": 5,
+ "minimum": 0
+ }
+ }
+ ]
}
],
"outputs": [],
diff --git a/database-commons/pom.xml b/database-commons/pom.xml
index 67dc8e82e..b1566c75f 100644
--- a/database-commons/pom.xml
+++ b/database-commons/pom.xml
@@ -41,6 +41,13 @@
guava
+
+
+ dev.failsafe
+ failsafe
+ 3.3.2
+
+
io.cdap.cdap
@@ -64,6 +71,12 @@
org.mockito
mockito-core
+
+ org.junit.jupiter
+ junit-jupiter
+ RELEASE
+ test
+
diff --git a/database-commons/src/main/java/io/cdap/plugin/db/CommonSchemaReader.java b/database-commons/src/main/java/io/cdap/plugin/db/CommonSchemaReader.java
index 28c56db8c..f4cfe8322 100644
--- a/database-commons/src/main/java/io/cdap/plugin/db/CommonSchemaReader.java
+++ b/database-commons/src/main/java/io/cdap/plugin/db/CommonSchemaReader.java
@@ -19,7 +19,6 @@
import com.google.common.collect.Lists;
import io.cdap.cdap.api.data.schema.Schema;
import io.cdap.plugin.common.db.DBUtils;
-
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
@@ -53,8 +52,8 @@ public List getSchemaFields(ResultSet resultSet) throws SQLExcepti
@Override
public Schema getSchema(ResultSetMetaData metadata, int index) throws SQLException {
return DBUtils.getSchema(metadata.getColumnTypeName(index), metadata.getColumnType(index),
- metadata.getPrecision(index), metadata.getScale(index), metadata.getColumnName(index),
- metadata.isSigned(index), true);
+ metadata.getPrecision(index), metadata.getScale(index), metadata.getColumnName(index),
+ metadata.isSigned(index), true);
}
@Override
diff --git a/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfig.java b/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfig.java
index 588ed78b8..d17adadde 100644
--- a/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfig.java
+++ b/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfig.java
@@ -45,6 +45,12 @@ public abstract class ConnectionConfig extends PluginConfig implements DatabaseC
public static final String CONNECTION_ARGUMENTS = "connectionArguments";
public static final String JDBC_PLUGIN_NAME = "jdbcPluginName";
public static final String JDBC_PLUGIN_TYPE = "jdbc";
+ private static final String NAME_INITIAL_RETRY_DURATION = "initialRetryDuration";
+ private static final String NAME_MAX_RETRY_DURATION = "maxRetryDuration";
+ private static final String NAME_MAX_RETRY_COUNT = "maxRetryCount";
+ public static final int DEFAULT_INITIAL_RETRY_DURATION_SECONDS = 5;
+ public static final int DEFAULT_MAX_RETRY_COUNT = 80;
+ public static final int DEFAULT_MAX_RETRY_DURATION_SECONDS = 5;
@Name(JDBC_PLUGIN_NAME)
@Description("Name of the JDBC driver to use. This is the value of the 'jdbcPluginName' key defined in the JSON " +
@@ -71,6 +77,41 @@ public abstract class ConnectionConfig extends PluginConfig implements DatabaseC
@Macro
public String connectionArguments;
+ @Name(NAME_INITIAL_RETRY_DURATION)
+ @Description("Time taken for the first retry. Default is 5 seconds.")
+ @Nullable
+ @Macro
+ private Integer initialRetryDuration;
+
+ @Name(NAME_MAX_RETRY_DURATION)
+ @Description("Maximum time in seconds retries can take. Default is 80 seconds.")
+ @Nullable
+ @Macro
+ private Integer maxRetryDuration;
+
+ @Name(NAME_MAX_RETRY_COUNT)
+ @Description("Maximum number of retries allowed. Default is 5.")
+ @Nullable
+ @Macro
+ private Integer maxRetryCount;
+
+
+ @Nullable
+ public Integer getInitialRetryDuration() {
+ return initialRetryDuration == null ? DEFAULT_INITIAL_RETRY_DURATION_SECONDS : initialRetryDuration;
+ }
+
+ @Nullable
+ public Integer getMaxRetryDuration() {
+ return maxRetryDuration == null ? DEFAULT_MAX_RETRY_DURATION_SECONDS : maxRetryDuration;
+ }
+
+ @Nullable
+ public Integer getMaxRetryCount() {
+ return maxRetryCount == null ? DEFAULT_MAX_RETRY_COUNT : maxRetryCount;
+ }
+
+
public ConnectionConfig() {
}
diff --git a/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfigAccessor.java b/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfigAccessor.java
index 253422e79..49cf0ce10 100644
--- a/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfigAccessor.java
+++ b/database-commons/src/main/java/io/cdap/plugin/db/ConnectionConfigAccessor.java
@@ -39,6 +39,8 @@ public class ConnectionConfigAccessor {
public static final String OPERATION_NAME = "io.cdap.plugin.db.operation.name";
public static final String RELATION_TABLE_KEY = "io.cdap.plugin.db.relation.table.key";
+
+
private static final Gson GSON = new Gson();
private static final Type STRING_MAP_TYPE = new TypeToken