corgy-w commented on code in PR #10065: URL: https://github.com/apache/seatunnel/pull/10065#discussion_r2582037989
########## seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/operation/GetCheckpointHistoryOperation.java: ########## @@ -0,0 +1,110 @@ +/* + * 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.seatunnel.engine.server.operation; + +import org.apache.seatunnel.engine.core.checkpoint.CheckpointHistoryEntry; +import org.apache.seatunnel.engine.core.checkpoint.CheckpointStatus; +import org.apache.seatunnel.engine.server.SeaTunnelServer; +import org.apache.seatunnel.engine.server.checkpoint.monitor.CheckpointMonitorService; +import org.apache.seatunnel.engine.server.serializable.ClientToServerOperationDataSerializerHook; + +import com.hazelcast.internal.serialization.Data; +import com.hazelcast.nio.ObjectDataInput; +import com.hazelcast.nio.ObjectDataOutput; +import com.hazelcast.nio.serialization.IdentifiedDataSerializable; +import com.hazelcast.spi.impl.AllowedDuringPassiveState; +import com.hazelcast.spi.impl.operationservice.Operation; + +import java.io.IOException; +import java.util.List; + +public class GetCheckpointHistoryOperation extends Operation + implements IdentifiedDataSerializable, AllowedDuringPassiveState { + + private long jobId; + private Integer pipelineId; + private int limit; + private int statusOrdinal; + + private Data response; + + public GetCheckpointHistoryOperation() {} + + public GetCheckpointHistoryOperation( + long jobId, Integer pipelineId, int limit, int statusOrdinal) { + this.jobId = jobId; + this.pipelineId = pipelineId; + this.limit = limit; + this.statusOrdinal = statusOrdinal; + } + + @Override + public void run() throws Exception { + SeaTunnelServer service = getService(); + CheckpointMonitorService monitorService = service.getCheckpointMonitorService(); + List<CheckpointHistoryEntry> entries = + monitorService == null + ? java.util.Collections.emptyList() Review Comment: Let's make some changes. In other parts of pr, it's all extracted -- 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]
