nastra commented on code in PR #14465:
URL: https://github.com/apache/iceberg/pull/14465#discussion_r2560188058
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -1010,6 +1011,82 @@ private FileIO tableFileIO(
return newFileIO(context, fullConf, storageCredentials);
}
+ /**
+ * Create a new {@link RESTTableOperations} instance for simple table
operations.
+ *
+ * <p>This method can be overridden in subclasses to provide custom table
operations
+ * implementations.
+ *
+ * @param restClient the REST client to use for communicating with the
catalog server
+ * @param path the REST path for the table
+ * @param headers a supplier for additional HTTP headers to include in
requests
+ * @param fileIO the FileIO implementation for reading and writing table
metadata and data files
+ * @param current the current table metadata
+ * @param supportedEndpoints the set of supported REST endpoints
+ * @return a new RESTTableOperations instance
+ */
+ protected RESTTableOperations newTableOps(
+ RESTClient restClient,
+ String path,
+ Supplier<Map<String, String>> headers,
+ FileIO fileIO,
+ TableMetadata current,
+ Set<Endpoint> supportedEndpoints) {
+ return new RESTTableOperations(restClient, path, headers, fileIO, current,
supportedEndpoints);
+ }
+
+ /**
+ * Create a new {@link RESTTableOperations} instance for transaction-based
operations (create or
+ * replace).
+ *
+ * <p>This method can be overridden in subclasses to provide custom table
operations
+ * implementations for transaction-based operations.
+ *
+ * @param restClient the REST client to use for communicating with the
catalog server
+ * @param path the REST path for the table
+ * @param headers a supplier for additional HTTP headers to include in
requests
+ * @param fileIO the FileIO implementation for reading and writing table
metadata and data files
+ * @param updateType the type of update being performed (CREATE, REPLACE, or
SIMPLE)
+ * @param createChanges the list of metadata updates to apply during table
creation or replacement
+ * @param current the current table metadata (may be null for CREATE
operations)
+ * @param supportedEndpoints the set of supported REST endpoints
+ * @return a new RESTTableOperations instance
+ */
+ protected RESTTableOperations newTableOpsForTransaction(
Review Comment:
I think it's fine to just call this `newTableOps()`. The fact that this is
used for a transaction doesn't really matter, since the main difference is
really that we're passing the `UpdateType` and a list of `MetadataUpdate`s
--
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]