s7monk commented on code in PR #222: URL: https://github.com/apache/paimon-webui/pull/222#discussion_r1601076855
########## paimon-web-server/src/main/java/org/apache/paimon/web/server/service/JobService.java: ########## @@ -0,0 +1,92 @@ +/* + * 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.web.server.service; + +import org.apache.paimon.web.server.data.dto.JobSubmitDTO; +import org.apache.paimon.web.server.data.dto.ResultFetchDTO; +import org.apache.paimon.web.server.data.dto.StopJobDTO; +import org.apache.paimon.web.server.data.model.JobInfo; +import org.apache.paimon.web.server.data.vo.JobStatisticsVO; +import org.apache.paimon.web.server.data.vo.JobVO; +import org.apache.paimon.web.server.data.vo.ResultDataVO; + +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** Job Service. */ +public interface JobService extends IService<JobInfo> { + + /** + * Submits a new job based on the provided job submission data. + * + * @param jobSubmitDTO the data transfer object containing job submission details + * @return the job view object after submission + */ + JobVO submitJob(JobSubmitDTO jobSubmitDTO); + + /** + * Fetches the result of a job specified by the result fetch data transfer object. + * + * @param resultFetchDTO the data transfer object containing job result fetching details + * @return result data view object containing the job results + */ + ResultDataVO fetchResult(ResultFetchDTO resultFetchDTO); + + /** + * Lists all jobs. + * + * @return a list of job view objects + */ + List<JobVO> listJobs(); + + /** + * Lists jobs in a paginated format. + * + * @param current the current page number + * @param size the number of jobs per page + * @return a list of job view objects for the specified page + */ + List<JobVO> listJobsByPage(int current, int size); + + /** + * Retrieves detailed information about a job identified by its job ID. + * + * @param jobId the unique identifier of the job + * @return job information object + */ + JobInfo getJobByJobId(String jobId); + + /** + * Retrieves statistics about jobs. + * + * @return a job statistics view object containing aggregated job data + */ + JobStatisticsVO getJobStatistics(); + + /** + * Stops a job as specified by the stop job data transfer object. + * + * @param stopJobDTO the data transfer object containing job stopping details + */ + void stop(StopJobDTO stopJobDTO); + + /** Refreshes the status of the current Flink job. */ + void refreshFlinkJobStatus(); Review Comment: done. ########## paimon-web-server/src/main/java/org/apache/paimon/web/server/service/JobService.java: ########## @@ -0,0 +1,92 @@ +/* + * 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.web.server.service; + +import org.apache.paimon.web.server.data.dto.JobSubmitDTO; +import org.apache.paimon.web.server.data.dto.ResultFetchDTO; +import org.apache.paimon.web.server.data.dto.StopJobDTO; +import org.apache.paimon.web.server.data.model.JobInfo; +import org.apache.paimon.web.server.data.vo.JobStatisticsVO; +import org.apache.paimon.web.server.data.vo.JobVO; +import org.apache.paimon.web.server.data.vo.ResultDataVO; + +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** Job Service. */ +public interface JobService extends IService<JobInfo> { + + /** + * Submits a new job based on the provided job submission data. + * + * @param jobSubmitDTO the data transfer object containing job submission details + * @return the job view object after submission + */ + JobVO submitJob(JobSubmitDTO jobSubmitDTO); + + /** + * Fetches the result of a job specified by the result fetch data transfer object. + * + * @param resultFetchDTO the data transfer object containing job result fetching details + * @return result data view object containing the job results + */ + ResultDataVO fetchResult(ResultFetchDTO resultFetchDTO); + + /** + * Lists all jobs. + * + * @return a list of job view objects + */ + List<JobVO> listJobs(); + + /** + * Lists jobs in a paginated format. + * + * @param current the current page number + * @param size the number of jobs per page + * @return a list of job view objects for the specified page + */ + List<JobVO> listJobsByPage(int current, int size); + + /** + * Retrieves detailed information about a job identified by its job ID. + * + * @param jobId the unique identifier of the job + * @return job information object + */ + JobInfo getJobByJobId(String jobId); Review Comment: done. -- 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]
