Skip to content

Commit

Permalink
cloneable support and protocol addition
Browse files Browse the repository at this point in the history
  • Loading branch information
dstreev committed May 21, 2024
1 parent e239470 commit 72edea2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.cloudera.utils.hive</groupId>
<artifactId>hive-sre</artifactId>
<name>hive-sre</name>
<version>3.0.1.5</version>
<version>3.0.1.6</version>
<url>https://github.com/cloudera-labs/hive-sre</url>
<build>
<finalName>${project.artifactId}</finalName>
Expand Down Expand Up @@ -248,7 +248,7 @@
<maven.surefire.version>3.1.2</maven.surefire.version>
<maven.site.version>3.7.1</maven.site.version>
<maven.jar.version>3.3.0</maven.jar.version>
<hadoop-cli.version>2.4.3.3</hadoop-cli.version>
<hadoop-cli.version>2.4.3.4</hadoop-cli.version>
<hikari.version>4.0.3</hikari.version>
<oracle.client.version>12.1.0.2</oracle.client.version>
<mariadb.client.version>2.7.3</mariadb.client.version>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<groupId>com.cloudera.utils.hive</groupId>
<artifactId>hive-sre</artifactId>
<version>3.0.1.5</version>
<version>3.0.1.6</version>

<name>hive-sre</name>

Expand Down Expand Up @@ -64,7 +64,7 @@

<gateway-shell.version>1.0.0</gateway-shell.version>

<hadoop-cli.version>2.4.3.3</hadoop-cli.version>
<hadoop-cli.version>2.4.3.4</hadoop-cli.version>

</properties>

Expand Down
13 changes: 12 additions & 1 deletion src/main/java/com/cloudera/utils/hive/config/ConnectionPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/com/cloudera/utils/hive/config/DBStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 72edea2

Please sign in to comment.