-
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 support for external engines (#84)
* Add Engine CRD * Use datagen and blackhole connectors for demodb * Add fat driver for integration tests
- Loading branch information
1 parent
f10e6e8
commit 0e19953
Showing
58 changed files
with
2,321 additions
and
66 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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: hoptimator.linkedin.com/v1alpha1 | ||
kind: Engine | ||
metadata: | ||
name: flink-engine | ||
spec: | ||
url: jdbc:flink://localhost:8083 | ||
dialect: Flink | ||
|
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
15 changes: 15 additions & 0 deletions
15
hoptimator-api/src/main/java/com/linkedin/hoptimator/Engine.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,15 @@ | ||
package com.linkedin.hoptimator; | ||
|
||
import javax.sql.DataSource; | ||
|
||
/** An execution engine. */ | ||
public interface Engine { | ||
|
||
String engineName(); | ||
|
||
DataSource dataSource(); | ||
|
||
SqlDialect dialect(); | ||
|
||
String url(); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** fat jar for integration tests */ | ||
|
||
plugins { | ||
id 'com.gradleup.shadow' version '8.3.5' | ||
id 'java' | ||
} | ||
|
||
dependencies { | ||
// include various plugins | ||
implementation project(':hoptimator-avro') | ||
implementation project(':hoptimator-demodb') | ||
implementation project(":hoptimator-kafka") | ||
implementation project(":hoptimator-venice") | ||
implementation libs.flink.jdbc | ||
|
||
implementation project(':hoptimator-jdbc') | ||
implementation project(':hoptimator-util') | ||
implementation project(':hoptimator-k8s') | ||
} | ||
|
||
shadowJar { | ||
zip64 true | ||
mergeServiceFiles() | ||
} |
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
47 changes: 47 additions & 0 deletions
47
hoptimator-k8s/src/main/java/com/linkedin/hoptimator/k8s/K8sEngine.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,47 @@ | ||
package com.linkedin.hoptimator.k8s; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import com.linkedin.hoptimator.Engine; | ||
import com.linkedin.hoptimator.SqlDialect; | ||
|
||
import java.util.Objects; | ||
|
||
import org.apache.calcite.adapter.jdbc.JdbcSchema; | ||
|
||
|
||
public class K8sEngine implements Engine { | ||
|
||
private final String name; | ||
private final String url; | ||
private final SqlDialect dialect; | ||
private final String driver; | ||
|
||
public K8sEngine(String name, String url, SqlDialect dialect, String driver) { | ||
this.name = name; | ||
this.url = Objects.requireNonNull(url, "url"); | ||
this.dialect = dialect; | ||
this.driver = driver; | ||
} | ||
|
||
@Override | ||
public String engineName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public DataSource dataSource() { | ||
// TODO support username, password via Secrets | ||
return JdbcSchema.dataSource(url, driver, null, null); | ||
} | ||
|
||
@Override | ||
public String url() { | ||
return url; | ||
} | ||
|
||
@Override | ||
public SqlDialect dialect() { | ||
return dialect; | ||
} | ||
} |
Oops, something went wrong.