forked from apache/gravitino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[apache#1449] feat(catalogs): Introudce new module
bundled-catalog
…
…for query engine. (apache#1454) ### What changes were proposed in this pull request? - Add a new module `bundled-catalog` to hold common information like property meta of all catalogs - Put `bundled-catalog` to `trino-connector` dependency and verify everything is OK. ### Why are the changes needed? We need a common module to hold the property meta of all catalogs so that the query engine depends on it can use it for query. Fix: apache#1449 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? Add some UT in module `Trino-connector`
- Loading branch information
Showing
18 changed files
with
239 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright 2024 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
|
||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar | ||
|
||
plugins { | ||
id("java") | ||
alias(libs.plugins.shadow) | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core")) | ||
implementation(project(":catalogs:catalog-hive")) | ||
implementation(project(":catalogs:catalog-lakehouse-iceberg")) | ||
implementation(project(":catalogs:catalog-jdbc-mysql")) | ||
implementation(project(":catalogs:catalog-jdbc-postgresql")) | ||
} | ||
|
||
tasks.withType<ShadowJar>(ShadowJar::class.java) { | ||
isZip64 = true | ||
configurations = listOf(project.configurations.compileClasspath.get()) | ||
archiveClassifier.set("") | ||
|
||
dependencies { | ||
exclude("org.*") | ||
exclude("javax.*") | ||
} | ||
|
||
exclude("**/package-info.class") | ||
exclude("**/*.properties") | ||
exclude("**/*.html") | ||
exclude("org/**") | ||
exclude("META-INF") | ||
exclude("META-INF/**") | ||
exclude("module-info.class") | ||
exclude("com/google/**") | ||
exclude("com/fasterxml/**") | ||
exclude("javax/**") | ||
exclude("schema/**") | ||
exclude("fr/**") | ||
exclude("google/**") | ||
exclude("groovy/**") | ||
exclude("images/**") | ||
exclude("**/*.conf") | ||
exclude("**/*.so") | ||
exclude("**/*.sxd") | ||
exclude("**/*.xsd") | ||
exclude("*.ddl") | ||
exclude("**/*.txt") | ||
exclude("**/*.md") | ||
exclude("**/*.dtd") | ||
exclude("**/*.thrift") | ||
exclude("**/*.jdo") | ||
exclude("**/LICENSE") | ||
exclude("**/*.MF") | ||
exclude("**/*.xml") | ||
exclude("*.proto") | ||
exclude("*.template") | ||
exclude("webapps") | ||
exclude("license/*") | ||
exclude("*.xml") | ||
exclude("*.css") | ||
exclude("*.jnilib") | ||
exclude("*.dll") | ||
exclude("*.jocl") | ||
exclude("NOTICE") | ||
|
||
minimize() | ||
} | ||
|
||
tasks.jar { | ||
dependsOn(tasks.named("shadowJar")) | ||
archiveClassifier.set("empty") | ||
} |
79 changes: 79 additions & 0 deletions
79
catalogs/bundled-catalog/src/main/java/com/datastrato/catalog/common/ClassProvider.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,79 @@ | ||
/* | ||
* Copyright 2024 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
|
||
package com.datastrato.catalog.common; | ||
|
||
import com.datastrato.gravitino.catalog.BasePropertiesMetadata; | ||
import com.datastrato.gravitino.catalog.PropertiesMetadata; | ||
import com.datastrato.gravitino.catalog.PropertyEntry; | ||
import com.datastrato.gravitino.catalog.hive.HiveCatalogPropertiesMeta; | ||
import com.datastrato.gravitino.catalog.hive.HiveSchemaPropertiesMetadata; | ||
import com.datastrato.gravitino.catalog.hive.HiveTablePropertiesMetadata; | ||
import com.datastrato.gravitino.catalog.lakehouse.iceberg.IcebergCatalogPropertiesMetadata; | ||
import com.datastrato.gravitino.catalog.lakehouse.iceberg.IcebergSchemaPropertiesMetadata; | ||
import com.datastrato.gravitino.catalog.lakehouse.iceberg.IcebergTablePropertiesMetadata; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* The {@link ClassProvider} class serves as a container for the necessary classes used by the | ||
* Gravitino query engine, with a primary focus on classes related to property metadata. | ||
* | ||
* <p>Purpose of this module and class: | ||
* | ||
* <pre> | ||
* - Catalog-related classes are essential for the query engine to directly access catalog information. | ||
* - The query engine should be able to detect catalog changes and automatically reload catalog-related | ||
* information to ensure synchronization. | ||
* - Including catalog-related jar packages directly is suboptimal for query engines as it may introduce | ||
* unnecessary content. | ||
* </pre> | ||
* | ||
* Therefore, this module is used to store the required classes for the query engine's | ||
* functionality. | ||
*/ | ||
public class ClassProvider { | ||
|
||
private static final Set<Class<?>> BASE_CLASS = | ||
new HashSet<Class<?>>() { | ||
{ | ||
add(BasePropertiesMetadata.class); | ||
add(PropertyEntry.class); | ||
add(PropertiesMetadata.class); | ||
} | ||
}; | ||
|
||
private static final Set<Class<?>> HIVE_NEED_CLASS = | ||
new HashSet<Class<?>>() { | ||
{ | ||
add(HiveTablePropertiesMetadata.class); | ||
add(HiveSchemaPropertiesMetadata.class); | ||
add(HiveCatalogPropertiesMeta.class); | ||
} | ||
}; | ||
|
||
private static final Set<Class<?>> ICEBERG_NEED_CLASS = | ||
new HashSet<Class<?>>() { | ||
{ | ||
add(IcebergTablePropertiesMetadata.class); | ||
add(IcebergSchemaPropertiesMetadata.class); | ||
add(IcebergCatalogPropertiesMetadata.class); | ||
} | ||
}; | ||
|
||
private static final Set<Class<?>> MYSQL_NEED_CLASS = | ||
new HashSet<Class<?>>() { | ||
{ | ||
// TODO | ||
} | ||
}; | ||
|
||
private static final Set<Class<?>> PG_NEED_CLASS = | ||
new HashSet<Class<?>>() { | ||
{ | ||
// TODO | ||
} | ||
}; | ||
} |
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
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
Oops, something went wrong.