mchades commented on code in PR #8592:
URL: https://github.com/apache/gravitino/pull/8592#discussion_r2357369477
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/dispatcher/IcebergTableEventDispatcher.java:
##########
@@ -230,4 +231,33 @@ public void renameTable(IcebergRequestContext context,
RenameTableRequest rename
eventBus.dispatchEvent(
new IcebergRenameTableEvent(context, gravitinoNameIdentifier,
renameTableRequest));
}
+
+ /**
+ * Get credentials for an Iceberg table.
+ *
+ * @param context Iceberg REST request context information.
+ * @param tableIdentifier The Iceberg table identifier.
+ * @return A {@link
org.apache.iceberg.rest.responses.LoadCredentialsResponse} object containing
+ * the credentials.
+ */
+ @Override
+ public LoadCredentialsResponse getTableCredentials(
+ IcebergRequestContext context, TableIdentifier tableIdentifier) {
+ NameIdentifier gravitinoNameIdentifier =
+ IcebergRestUtils.getGravitinoNameIdentifier(
+ metalakeName, context.catalogName(), tableIdentifier);
+ eventBus.dispatchEvent(new IcebergLoadTablePreEvent(context,
gravitinoNameIdentifier));
+ LoadCredentialsResponse loadCredentialsResponse;
+ try {
+ loadCredentialsResponse =
+ icebergTableOperationDispatcher.getTableCredentials(context,
tableIdentifier);
+ } catch (Exception e) {
+ eventBus.dispatchEvent(new IcebergLoadTableFailureEvent(context,
gravitinoNameIdentifier, e));
+ throw e;
+ }
+ // Note: Currently there is no dedicated IcebergLoadCredentialsEvent
event, reusing
+ // IcebergLoadTableEvent
Review Comment:
Should we add a new event for getTableCredentials in this PR? @FANNG1
or leave a todo here instead of using the wrong event
--
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]