baiyangtx commented on code in PR #4024:
URL: https://github.com/apache/amoro/pull/4024#discussion_r2652871555


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/TableMaintainerFactory.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.amoro.server.optimizing.maintainer;
+
+import org.apache.amoro.AmoroTable;
+import org.apache.amoro.TableFormat;
+import org.apache.amoro.formats.iceberg.maintainer.IcebergTableMaintainer;
+import org.apache.amoro.formats.iceberg.maintainer.MixedTableMaintainer;
+import org.apache.amoro.maintainer.TableMaintainer;
+import org.apache.amoro.server.table.DefaultTableRuntime;
+import org.apache.amoro.shade.guava32.com.google.common.base.Preconditions;
+import org.apache.amoro.table.MixedTable;
+import org.apache.iceberg.Table;
+
+/** Factory for creating {@link TableMaintainer} instances. */
+public class TableMaintainerFactory {
+
+  /**
+   * Create an Iceberg table maintainer with AMS context.
+   *
+   * @param table the Iceberg table
+   * @param tableRuntime the AMS table runtime
+   * @return IcebergTableMaintainer instance
+   */
+  public static IcebergTableMaintainer createIcebergMaintainer(
+      Table table, DefaultTableRuntime tableRuntime) {
+    return new IcebergTableMaintainer(
+        table,
+        tableRuntime.getTableIdentifier().getIdentifier(),
+        new DefaultTableMaintainerContext(tableRuntime));
+  }
+
+  /**
+   * Create a {@link TableMaintainer} for the given table.
+   *
+   * @param amoroTable the Amoro table
+   * @param tableRuntime the table runtime
+   * @return TableMaintainer instance
+   */
+  public static TableMaintainer create(AmoroTable<?> amoroTable, Object 
tableRuntime) {

Review Comment:
   ```suggestion
     public static TableMaintainer create(AmoroTable<?> amoroTable, 
TableRuntime tableRuntime) {
   ```



##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/TableMaintainers.java:
##########
@@ -21,25 +21,42 @@
 import org.apache.amoro.AmoroTable;
 import org.apache.amoro.TableFormat;
 import org.apache.amoro.TableRuntime;
+import org.apache.amoro.formats.iceberg.maintainer.MixedTableMaintainer;
+import org.apache.amoro.maintainer.TableMaintainer;
 import org.apache.amoro.server.table.DefaultTableRuntime;
-import org.apache.amoro.shade.guava32.com.google.common.base.Preconditions;
 import org.apache.amoro.table.MixedTable;
 import org.apache.iceberg.Table;
 
 /** Factory for creating {@link TableMaintainer}. */
+@Deprecated

Review Comment:
   Maybe we can remove this class directly?



##########
amoro-ams/src/test/java/org/apache/amoro/server/optimizing/maintainer/TestDataExpire.java:
##########
@@ -31,6 +31,8 @@
 import org.apache.amoro.data.ChangeAction;
 import org.apache.amoro.data.DataFileType;
 import org.apache.amoro.data.PrimaryKeyedFile;
+import org.apache.amoro.formats.iceberg.maintainer.IcebergTableMaintainer;

Review Comment:
   Can we move those Tests to iceberg-format module? 



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