-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add per-connection driver properties (#99)
Co-authored-by: Joseph Grogan <jogrogan@linkedin.com>
- Loading branch information
1 parent
2e84b5a
commit bada97a
Showing
34 changed files
with
389 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
hoptimator-api/src/main/java/com/linkedin/hoptimator/ConnectorProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package com.linkedin.hoptimator; | ||
|
||
import java.util.Collection; | ||
import java.util.Properties; | ||
|
||
|
||
public interface ConnectorProvider { | ||
|
||
<T> Collection<Connector<T>> connectors(Class<T> clazz); | ||
<T> Collection<Connector<T>> connectors(Class<T> clazz, Properties connectionProperties); | ||
} |
3 changes: 2 additions & 1 deletion
3
hoptimator-api/src/main/java/com/linkedin/hoptimator/DeployerProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package com.linkedin.hoptimator; | ||
|
||
import java.util.Collection; | ||
import java.util.Properties; | ||
|
||
|
||
public interface DeployerProvider { | ||
|
||
<T> Collection<Deployer<T>> deployers(Class<T> clazz); | ||
<T> Collection<Deployer<T>> deployers(Class<T> clazz, Properties connectionProperties); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,55 @@ | ||
plugins { | ||
id 'java' | ||
id 'maven-publish' | ||
} | ||
|
||
dependencies { | ||
implementation project(':hoptimator-api') | ||
implementation project(':hoptimator-util') | ||
implementation libs.calcite.core | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name 'GitHubPackages' | ||
url = 'https://maven.pkg.github.com/linkedin/Hoptimator' | ||
credentials { | ||
username = System.getenv('GITHUB_ACTOR') | ||
password = System.getenv('GITHUB_TOKEN') | ||
} | ||
} | ||
maven { | ||
name 'LinkedInJFrog' | ||
url 'https://linkedin.jfrog.io/artifactory/hoptimator' | ||
credentials { | ||
username = System.getenv('JFROG_USERNAME') | ||
password = System.getenv('JFROG_API_KEY') | ||
} | ||
} | ||
} | ||
publications { | ||
maven(MavenPublication) { | ||
groupId = 'com.linkedin.hoptimator' | ||
artifactId = 'hoptimator-demodb' | ||
version = System.getenv('VERSION') | ||
from components.java | ||
pom { | ||
name = 'hoptimator-api' | ||
description = 'In-memory database driver for testing' | ||
url = 'https://github.com/linkedin/Hoptimator' | ||
licenses { | ||
license { | ||
name = 'BSD 2-Clause' | ||
url = 'https://raw.githubusercontent.com/linkedin/Hoptimator/main/LICENSE' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com:linkedin/Hoptimator.git' | ||
developerConnection = 'scm:git:ssh://github.com:linkedin/Hoptimator.git' | ||
url = 'https://github.com/linkedin/Hoptimator' | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
hoptimator-jdbc/src/main/java/com/linkedin/hoptimator/jdbc/HoptimatorConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.linkedin.hoptimator.jdbc; | ||
|
||
import java.sql.Connection; | ||
import java.sql.Statement; | ||
import java.sql.SQLException; | ||
import java.util.Properties; | ||
|
||
import org.apache.calcite.jdbc.CalciteConnection; | ||
import org.apache.calcite.jdbc.CalcitePrepare; | ||
|
||
import com.linkedin.hoptimator.util.DelegatingConnection; | ||
|
||
|
||
public class HoptimatorConnection extends DelegatingConnection { | ||
|
||
private final CalciteConnection connection; | ||
private final Properties connectionProperties; | ||
|
||
public HoptimatorConnection(CalciteConnection connection, Properties connectionProperties) { | ||
super(connection); | ||
this.connection = connection; | ||
this.connectionProperties = connectionProperties; | ||
} | ||
|
||
@Override | ||
public Statement createStatement() throws SQLException { | ||
return connection.createStatement(); | ||
} | ||
|
||
public Properties connectionProperties() { | ||
return connectionProperties; | ||
} | ||
|
||
public CalcitePrepare.Context createPrepareContext() { | ||
return connection.createPrepareContext(); | ||
} | ||
|
||
public CalciteConnection calciteConnection() { | ||
return connection; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.