majin1102 commented on code in PR #3486: URL: https://github.com/apache/amoro/pull/3486#discussion_r2108733328
########## amoro-ams/src/main/java/org/apache/amoro/server/persistence/mapper/ProcessStateMapper.java: ########## @@ -0,0 +1,87 @@ +/* + * 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.persistence.mapper; + +import org.apache.amoro.process.TableProcessState; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.ResultMap; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; + +import java.util.Map; + +public interface ProcessStateMapper { + + @Insert( + "INSERT INTO table_process_state " + + "(process_id, action, table_id, retry_num, status, start_time, end_time, fail_reason, summary) " + + "VALUES " + + "(#{id}, #{action}, #{tableId}, #{retryNumber}, #{status}, #{startTime}, #{endTime}, #{failedReason}, #{summary})") + @Options(useGeneratedKeys = true, keyProperty = "id") + void createProcessState(TableProcessState state); + + @Update( + "UPDATE table_process_state " + + "SET status = #{status}, start_time = #{startTime} " + + "WHERE process_id = #{id} and retry_num = #{retryNumber}") + void updateProcessRunning(TableProcessState state); Review Comment: I think update is better, and upateXXX is all around. Maybe you could raise a PR to meet this globally, Let's focus on Process API itself in this PR -- 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]
