-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#1449] feat(catalogs): Introudce new module bundled-catalog
for query engine.
#1454
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
278e749
init catalog-common
yuqi1129 13df6a4
Add more code
yuqi1129 a8f0bd1
Remove some unused code.
yuqi1129 c7abcfe
Resolve discussion
yuqi1129 0bdc370
Resolve discussion
yuqi1129 22fbde3
Revert some code again
yuqi1129 4e93dcd
exclude more files
yuqi1129 debd9c2
Fix test error
yuqi1129 8eccbf0
Fix some mistakes in docs
yuqi1129 d549bb9
Fix discussion about ut
yuqi1129 97bf821
Fix ci error
yuqi1129 2a8c6e2
Fix ci package error
yuqi1129 20b0a2c
Merge branch 'main' of github.com:datastrato/graviton into issue_1449
yuqi1129 b646382
Fix test
yuqi1129 828ffd0
Fix the discussion
yuqi1129 6ebd4e5
merge main and resolve discussion
yuqi1129 c720f9c
Merge branch_issue_1449
yuqi1129 8a6129f
Merge branch_issue_1449
yuqi1129 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
build
andcopyDepends
tasks ofcatalog-hive
use the same output directory 'build/libs', which is needed by taskshadowJar
inbundled-catalog
, gradle will get errors and says "taskshadowJar
depends on taskcopyDepends
".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd better add comment on the file to describe it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.