diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index f7d05dc..3c392c8 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.cloudera.utils.hive hive-sre hive-sre - 3.0.1.5 + 3.0.1.6 https://github.com/cloudera-labs/hive-sre ${project.artifactId} @@ -248,7 +248,7 @@ 3.1.2 3.7.1 3.3.0 - 2.4.3.3 + 2.4.3.4 4.0.3 12.1.0.2 2.7.3 diff --git a/pom.xml b/pom.xml index 8ea7142..9fc21a1 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ com.cloudera.utils.hive hive-sre - 3.0.1.5 + 3.0.1.6 hive-sre @@ -64,7 +64,7 @@ 1.0.0 - 2.4.3.3 + 2.4.3.4 diff --git a/src/main/java/com/cloudera/utils/hive/config/ConnectionPool.java b/src/main/java/com/cloudera/utils/hive/config/ConnectionPool.java index 81b0a27..eed2764 100644 --- a/src/main/java/com/cloudera/utils/hive/config/ConnectionPool.java +++ b/src/main/java/com/cloudera/utils/hive/config/ConnectionPool.java @@ -17,11 +17,22 @@ package com.cloudera.utils.hive.config; -public class ConnectionPool { +public class ConnectionPool implements Cloneable { private int min = 1; private int max = 3; private int timeout = 120; + @Override + public ConnectionPool clone() { + try { + ConnectionPool clone = (ConnectionPool) super.clone(); + // TODO: copy mutable state here, so the clone can't change the internals of the original + return clone; + } catch (CloneNotSupportedException e) { + throw new AssertionError(); + } + } + public int getMin() { return min; } diff --git a/src/main/java/com/cloudera/utils/hive/config/DBStore.java b/src/main/java/com/cloudera/utils/hive/config/DBStore.java index 5f23bc7..3b32651 100644 --- a/src/main/java/com/cloudera/utils/hive/config/DBStore.java +++ b/src/main/java/com/cloudera/utils/hive/config/DBStore.java @@ -21,7 +21,19 @@ import javax.validation.constraints.NotNull; import java.util.Properties; -public class DBStore { +public class DBStore implements Cloneable { + @Override + public DBStore clone() { + try { + DBStore clone = (DBStore) super.clone(); + ConnectionPool connectionPoolClone = this.connectionPool.clone(); + clone.setConnectionPool(connectionPoolClone); + return clone; + } catch (CloneNotSupportedException e) { + throw new AssertionError(); + } + } + public enum DB_TYPE { MYSQL, POSTGRES, ORACLE // , MSSQL };