feat(ignite): add Apache Ignite 2.x support

This commit is contained in:
SCSTC authored and GitHub committed 2026-08-19 02:04:13 +08:00
1 parent e5ccb5cb01
commit 703c6bc81f
31 files changed
+467 -4

No files matched your search

+7
View File
@@ -260,6 +260,13 @@ const AGENT_CATALOG: &[AgentCatalogEntry] = &[
store_visible: true,
profiles: &[],
},
AgentCatalogEntry {
db_type: DatabaseType::Ignite,
key: "ignite",
label: "Apache Ignite",
store_visible: true,
profiles: &[],
},
AgentCatalogEntry {
db_type: DatabaseType::Sundb,
key: "sundb",
+1
View File
@@ -182,6 +182,7 @@ macro_rules! agent_connection_pool_database_type {
| DatabaseType::Cassandra
| DatabaseType::Bigquery
| DatabaseType::Kylin
| DatabaseType::Ignite
| DatabaseType::Sundb
| DatabaseType::Oscar
| DatabaseType::Tdengine
+33
View File
@@ -2897,6 +2897,23 @@ fn agent_java_args_with_extra_opts(
args.push("-Djava.net.preferIPv4Stack=true".to_string());
}
// Ignite's GridUnsafe/BinaryContext reflect into JDK internals; without these
// opens every connect fails with ExceptionInInitializerError on JDK 9+.
if agent_jar_path_matches_key(jar_path, "ignite") {
args.extend(
[
"--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens=java.base/java.util=ALL-UNNAMED",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED",
]
.into_iter()
.map(str::to_string),
);
}
// Hive/Kerberos JDBC drivers read JAAS and krb5 settings during JVM startup,
// so users need a process-level escape hatch before the agent jar is loaded.
if let Some(extra) = extra_opts {
@@ -3625,6 +3642,22 @@ mod tests {
assert!(!args.iter().any(|arg| arg == "-Djava.net.preferIPv4Stack=true"));
}
#[test]
fn agent_java_args_open_jdk_internals_for_ignite() {
let args = agent_java_args("/tmp/dbx/drivers/ignite/agent.jar");
assert!(args.iter().any(|arg| arg == "--add-opens=java.base/java.nio=ALL-UNNAMED"));
assert!(args.iter().any(|arg| arg == "--add-opens=java.base/java.util=ALL-UNNAMED"));
assert!(args.iter().any(|arg| arg == "--add-opens=java.base/java.lang=ALL-UNNAMED"));
}
#[test]
fn agent_java_args_do_not_open_jdk_internals_for_other_agents() {
let args = agent_java_args("/tmp/dbx/drivers/kylin/agent.jar");
assert!(!args.iter().any(|arg| arg == "--add-opens=java.base/java.nio=ALL-UNNAMED"));
}
#[test]
fn agent_java_args_include_custom_jvm_options_before_jar() {
let args = agent_java_args_with_extra(
+5
View File
@@ -600,6 +600,7 @@ pub enum DatabaseType {
VictoriaMetrics,
#[serde(rename = "questdb")]
Questdb,
Ignite,
Jdbc,
/// Message queue admin connection (Pulsar / Kafka / RocketMQ). The specific
/// system is determined by `external_config.systemKind`.
@@ -1143,6 +1144,7 @@ impl ConnectionConfig {
}
}
DatabaseType::Questdb => format!("questdb://{host}:{port}{db_part}"),
DatabaseType::Ignite => format!("ignite://{host}:{port}{db_part}"),
DatabaseType::Gbase => format!("gbase://{host}:{port}{db_part}"),
DatabaseType::H2 => format!("h2://{host}:{port}{db_part}"),
DatabaseType::Snowflake => format!("snowflake://{host}/{db_part}"),
@@ -1347,6 +1349,9 @@ impl ConnectionConfig {
DatabaseType::Questdb => {
format!("questdb://{}:{}@{host}:{port}{db_part}", username, password)
}
DatabaseType::Ignite => {
format!("ignite://{}:{}@{host}:{port}{db_part}", username, password)
}
DatabaseType::Gbase => {
format!("gbase://{}:{}@{host}:{port}{db_part}", username, password)
}
@@ -670,7 +670,7 @@ pub fn profile_for(db_type: DatabaseType) -> DdlDialectProfile {
ClickHouse => clickhouse_profile(),
DuckDb | Questdb | SapHana | Teradata | Snowflake | Trino | PrestoSql | Hive | Kyuubi | Impala | Spark
| Db2 | Informix | Bigquery | Kylin | Oscar | Tdengine | Iotdb | Databricks | Jdbc => {
| Db2 | Informix | Bigquery | Kylin | Ignite | Oscar | Tdengine | Iotdb | Databricks | Jdbc => {
conservative_ansi(db_type)
}