Xiao-zhen-Liu commented on code in PR #4067:
URL: https://github.com/apache/texera/pull/4067#discussion_r2547168517


##########
common/workflow-core/src/main/scala/org/apache/texera/service/util/BigObjectManager.scala:
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.texera.service.util
+
+import com.typesafe.scalalogging.LazyLogging
+import org.apache.amber.core.executor.OperatorExecutor
+import org.apache.amber.core.tuple.BigObject
+import org.apache.texera.dao.SqlServer
+import org.apache.texera.dao.jooq.generated.Tables.BIG_OBJECT
+
+import java.util.UUID
+import scala.jdk.CollectionConverters._
+
+/**
+  * Manages the lifecycle of BigObjects stored in S3.
+  *
+  * Handles creation, tracking, and cleanup of large objects that exceed
+  * normal tuple size limits. Objects are automatically cleaned up when
+  * their associated workflow execution completes.
+  */
+object BigObjectManager extends LazyLogging {
+  private val DEFAULT_BUCKET = "texera-big-objects"
+  private lazy val db = SqlServer.getInstance().createDSLContext()
+
+  /**
+    * Creates a new BigObject reference and registers it for tracking.
+    * The actual data upload happens separately via BigObjectOutputStream.
+    *
+    * @param executor The operator executor providing execution context
+    * @return S3 URI string for the new BigObject (format: s3://bucket/key)
+    * @throws RuntimeException if database registration fails
+    */
+  def create(executor: OperatorExecutor): String = {

Review Comment:
   I also feel it is hacky to pass `OperatorExecutor` here but I need to look 
at the complete code to understand this.
   I think ultimately `port_id` should be part of the tracking. It seems this 
current version has many assumptions, e.g., a big object is only created by a 
FileScan operator, and the current version only tracks the source of 
bigObjects? We need to discuss which of these assumptions will be generalized 
in the future.



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