gavin9402 commented on code in PR #8179:
URL: https://github.com/apache/paimon/pull/8179#discussion_r3550407527


##########
paimon-api/src/main/java/org/apache/paimon/rest/requests/CreateResourceRequest.java:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.rest.requests;
+
+import org.apache.paimon.rest.RESTRequest;
+
+import 
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import 
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonGetter;
+import 
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import 
org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Request for creating resource. */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CreateResourceRequest implements RESTRequest {
+
+    private static final String FIELD_NAME = "name";
+    private static final String FIELD_COMMENT = "comment";
+    private static final String FIELD_URI = "uri";
+    private static final String FIELD_RESOURCE_TYPE = "resourceType";
+
+    @JsonProperty(FIELD_NAME)
+    private final String name;
+
+    @JsonProperty(FIELD_COMMENT)
+    private final String comment;
+
+    @JsonProperty(FIELD_URI)
+    private final String uri;

Review Comment:
   In the current design, I split resource upload and creation into two stages: 
first, files are uploaded through the file management platform to obtain a URI, 
and then the SDK creates the resource metadata based on that URI.
   
   The main considerations behind this are:
   
   1. The files to be uploaded are usually relatively large, so having the 
RestServer handle file uploads would be quite heavy.
   2. We want to keep the metastore service focused only on metadata management 
as much as possible.
   3. Some file management platforms also provide SDKs for direct frontend 
uploads, so resource files would not need to pass through the server at all.



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

Reply via email to