pvary commented on code in PR #12774:
URL: https://github.com/apache/iceberg/pull/12774#discussion_r2550885450


##########
core/src/main/java/org/apache/iceberg/formats/FormatModelRegistry.java:
##########
@@ -229,4 +206,27 @@ private static <D, S> FormatModel<D, S> 
factoryFor(FileFormat format, Class<D> t
         model != null, "Format model is not registered for format %s and type 
%s", format, type);
     return model;
   }
+
+  private static boolean equals(FormatModel<?, ?> model1, FormatModel<?, ?> 
model2) {
+    return Objects.equals(model1.getClass().getName(), 
model2.getClass().getName())
+        && Objects.equals(model1.type().getName(), model2.type().getName())
+        && Objects.equals(
+            model1.schemaType() == null ? null : model1.schemaType().getName(),
+            model2.schemaType() == null ? null : 
model2.schemaType().getName());
+  }
+
+  @SuppressWarnings("CatchBlockLogException")
+  private static void registerSupportedFormats() {
+    // Uses dynamic methods to call the `register` for the listed classes
+    for (String classToRegister : CLASSES_TO_REGISTER) {
+      try {
+        
DynMethods.builder("register").impl(classToRegister).buildStaticChecked().invoke();
+      } catch (NoSuchMethodException e) {
+        // failing to register a factory is normal and does not require a 
stack trace
+        LOG.info("Unable to register {}: {}", classToRegister, e.getMessage());

Review Comment:
   Changed the comment.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to