FANNG1 commented on PR #4987:
URL: https://github.com/apache/gravitino/pull/4987#issuecomment-2372623460
> @FANNG1 Thanks for sharing this. I am curious in this PR, how can users
access `icebergCatalogWrapperManager` instance if user plugin their API into
IRC?
1. `IcebergCatalogWrapperManager` injected to jersey in `RESTService.java`
```java
icebergCatalogWrapperManager = new
IcebergCatalogWrapperManager(icebergConfig.getAllConfig());
icebergMetricsManager = new IcebergMetricsManager(icebergConfig);
config.register(
new AbstractBinder() {
@Override
protected void configure() {
bind(icebergCatalogWrapperManager).to(IcebergCatalogWrapperManager.class).ranked(1);
bind(icebergMetricsManager).to(IcebergMetricsManager.class).ranked(1);
}
});
```
2. The user plugin could use the injected `IcebergCatalogWrapperManager`
like `IcebergTableOperations`
```java
@Inject
public IcebergTableOperations(
IcebergCatalogWrapperManager icebergCatalogWrapperManager,
IcebergMetricsManager icebergMetricsManager) {
this.icebergCatalogWrapperManager = icebergCatalogWrapperManager;
this.icebergObjectMapper = IcebergObjectMapper.getInstance();
this.icebergMetricsManager = icebergMetricsManager;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]