hackergin commented on code in PR #25988: URL: https://github.com/apache/flink/pull/25988#discussion_r1919765053
########## flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/materializedtable/MaterializedTableManager.java: ########## @@ -1123,31 +1129,59 @@ private static JobStatus getJobStatus( } private static void cancelJob( - OperationExecutor operationExecutor, OperationHandle handle, String jobId) { + OperationExecutor operationExecutor, + OperationHandle handle, + ContinuousRefreshHandler refreshHandler) { operationExecutor.callStopJobOperation( - operationExecutor.getTableEnvironment(), + getTableEnvironment(operationExecutor, refreshHandler), handle, - new StopJobOperation(jobId, false, false)); + new StopJobOperation(refreshHandler.getJobId(), false, false)); } private static String stopJobWithSavepoint( - OperationExecutor executor, OperationHandle handle, String jobId) { + OperationExecutor executor, + OperationHandle handle, + ContinuousRefreshHandler refreshHandler) { // check savepoint dir is configured Optional<String> savepointDir = executor.getSessionContext().getSessionConf().getOptional(SAVEPOINT_DIRECTORY); - if (!savepointDir.isPresent()) { + if (savepointDir.isEmpty()) { throw new ValidationException( "Savepoint directory is not configured, can't stop job with savepoint."); } + String jobId = refreshHandler.getJobId(); ResultFetcher resultFetcher = executor.callStopJobOperation( - executor.getTableEnvironment(), + getTableEnvironment(executor, refreshHandler), handle, new StopJobOperation(jobId, true, false)); List<RowData> results = fetchAllResults(resultFetcher); return results.get(0).getString(0).toString(); } + /** + * Using the target and session cluster id configuration get the TableEnvironment. Review Comment: This part of the comment doesn't seem very useful. I removed it directly. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org