adutra commented on code in PR #2332:
URL: https://github.com/apache/polaris/pull/2332#discussion_r2276734351
##########
polaris-core/src/main/java/org/apache/polaris/core/connection/ConnectionType.java:
##########
@@ -77,4 +80,22 @@ public enum ConnectionType {
public int getCode() {
return this.code;
}
+
+ /**
+ * Get the factory identifier string used for CDI injection of the
appropriate
+ * ExternalCatalogFactory.
+ *
+ * @return the factory identifier string
+ */
+ public String getFactoryIdentifier() {
+ switch (this) {
+ case ICEBERG_REST:
+ return ICEBERG_REST_FACTORY_IDENTIFIER;
+ case HADOOP:
+ return HADOOP_FACTORY_IDENTIFIER;
+ default:
+ throw new UnsupportedOperationException(
+ "No factory identifier for connection type: " + this);
+ }
+ }
Review Comment:
You may want to just return `name().toLowerCase(Locale.ROOT)` – since most
CDI identifiers in Polaris (if not all) are lower-case.
```suggestion
public String getFactoryIdentifier() {
return name().toLowerCase(Locale.ROOT);
}
```
--
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]