-
Notifications
You must be signed in to change notification settings - Fork 394
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
[4958] feat(iceberg): support event listener for Iceberg REST server #5002
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f5beda9
support iceberg pre event listener
FANNG1 9a5a18f
fix comment
FANNG1 f5690e3
fix comment
FANNG1 fe508a6
fix comment
FANNG1 641f9e1
fix comment
FANNG1 fedb8dd
fix comment
FANNG1 c11ad89
fix comment
FANNG1 12baeeb
fix comment
FANNG1 9a3e988
fix comment
FANNG1 6a6eade
Merge branch 'main' into iceberg-event
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
|
||
tasks.all { | ||
enabled = false | ||
} | ||
} |
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
42 changes: 0 additions & 42 deletions
42
...n/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogConfigProvider.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -28,7 +28,13 @@ | |
import org.apache.gravitino.iceberg.service.IcebergCatalogWrapperManager; | ||
import org.apache.gravitino.iceberg.service.IcebergExceptionMapper; | ||
import org.apache.gravitino.iceberg.service.IcebergObjectMapperProvider; | ||
import org.apache.gravitino.iceberg.service.dispatcher.IcebergTableEventDispatcher; | ||
import org.apache.gravitino.iceberg.service.dispatcher.IcebergTableOperationDispatcher; | ||
import org.apache.gravitino.iceberg.service.dispatcher.IcebergTableOperationExecutor; | ||
import org.apache.gravitino.iceberg.service.metrics.IcebergMetricsManager; | ||
import org.apache.gravitino.iceberg.service.provider.IcebergConfigProvider; | ||
import org.apache.gravitino.iceberg.service.provider.IcebergConfigProviderFactory; | ||
import org.apache.gravitino.listener.EventBus; | ||
import org.apache.gravitino.metrics.MetricsSystem; | ||
import org.apache.gravitino.metrics.source.MetricsSource; | ||
import org.apache.gravitino.server.web.HttpServerMetricsSource; | ||
|
@@ -54,6 +60,7 @@ public class RESTService implements GravitinoAuxiliaryService { | |
|
||
private IcebergCatalogWrapperManager icebergCatalogWrapperManager; | ||
private IcebergMetricsManager icebergMetricsManager; | ||
private IcebergConfigProvider configProvider; | ||
|
||
private void initServer(IcebergConfig icebergConfig) { | ||
JettyServerConfig serverConfig = JettyServerConfig.fromConfig(icebergConfig); | ||
|
@@ -70,14 +77,25 @@ private void initServer(IcebergConfig icebergConfig) { | |
new HttpServerMetricsSource(MetricsSource.ICEBERG_REST_SERVER_METRIC_NAME, config, server); | ||
metricsSystem.register(httpServerMetricsSource); | ||
|
||
icebergCatalogWrapperManager = new IcebergCatalogWrapperManager(icebergConfig.getAllConfig()); | ||
icebergMetricsManager = new IcebergMetricsManager(icebergConfig); | ||
Map<String, String> configProperties = icebergConfig.getAllConfig(); | ||
EventBus eventBus = GravitinoEnv.getInstance().eventBus(); | ||
this.configProvider = IcebergConfigProviderFactory.create(configProperties); | ||
configProvider.initialize(configProperties); | ||
String metalakeName = configProvider.getMetalakeName(); | ||
this.icebergCatalogWrapperManager = | ||
new IcebergCatalogWrapperManager(configProperties, configProvider); | ||
this.icebergMetricsManager = new IcebergMetricsManager(icebergConfig); | ||
IcebergTableOperationExecutor icebergTableOperationExecutor = | ||
new IcebergTableOperationExecutor(icebergCatalogWrapperManager); | ||
IcebergTableEventDispatcher icebergTableEventDispatcher = | ||
new IcebergTableEventDispatcher(icebergTableOperationExecutor, eventBus, metalakeName); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add some necessary blank line in this code block to make this code block easy to read. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
config.register( | ||
new AbstractBinder() { | ||
@Override | ||
protected void configure() { | ||
bind(icebergCatalogWrapperManager).to(IcebergCatalogWrapperManager.class).ranked(1); | ||
bind(icebergMetricsManager).to(IcebergMetricsManager.class).ranked(1); | ||
bind(icebergTableEventDispatcher).to(IcebergTableOperationDispatcher.class).ranked(1); | ||
} | ||
}); | ||
|
||
|
@@ -118,6 +136,9 @@ public void serviceStop() throws Exception { | |
server.stop(); | ||
LOG.info("Iceberg REST service stopped"); | ||
} | ||
if (configProvider != null) { | ||
configProvider.close(); | ||
} | ||
if (icebergCatalogWrapperManager != null) { | ||
icebergCatalogWrapperManager.close(); | ||
} | ||
|
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.
This is too long, you need to make it less than 100 chars.
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.
updated