freesinger commented on code in PR #11188:
URL: https://github.com/apache/gravitino/pull/11188#discussion_r3332848398
##########
core/src/main/java/org/apache/gravitino/catalog/TableOperationDispatcher.java:
##########
@@ -81,7 +84,24 @@ public class TableOperationDispatcher extends
OperationDispatcher implements Tab
*/
public TableOperationDispatcher(
CatalogManager catalogManager, EntityStore store, IdGenerator
idGenerator) {
+ this(catalogManager, store, idGenerator, () ->
GravitinoEnv.getInstance().schemaDispatcher());
+ }
+
+ /**
+ * Creates a new TableOperationDispatcher instance.
+ *
+ * @param catalogManager The CatalogManager instance to be used for table
operations.
+ * @param store The EntityStore instance to be used for table operations.
+ * @param idGenerator The IdGenerator instance to be used for table
operations.
+ * @param schemaDispatcherSupplier The SchemaDispatcher supplier to ensure
schemas are imported.
+ */
+ public TableOperationDispatcher(
+ CatalogManager catalogManager,
+ EntityStore store,
+ IdGenerator idGenerator,
+ Supplier<SchemaDispatcher> schemaDispatcherSupplier) {
super(catalogManager, store, idGenerator);
+ this.schemaDispatcherSupplier = schemaDispatcherSupplier;
Review Comment:
Fixed. The constructor now validates schemaDispatcherSupplier with
Preconditions.checkNotNull, and usages go through a guarded
getSchemaDispatcher() helper to also fail fast if supplier.get() returns null.
--
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]