-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INLONG-10459][Manager] Support schedule instance callback to submit …
…Flink batch job (#10510) * [INLONG-10459][Manager] Support schedule instance callback to submit Flink batch job
- Loading branch information
1 parent
4cd124b
commit 1c37054
Showing
15 changed files
with
242 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../base/src/main/java/org/apache/inlong/manager/plugin/offline/FlinkOfflineJobOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* 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.inlong.manager.plugin.offline; | ||
|
||
import org.apache.inlong.manager.pojo.stream.InlongStreamInfo; | ||
import org.apache.inlong.manager.workflow.processor.OfflineJobOperator; | ||
|
||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
import static org.apache.inlong.manager.plugin.util.FlinkUtils.submitFlinkJobs; | ||
|
||
@NoArgsConstructor | ||
public class FlinkOfflineJobOperator implements OfflineJobOperator { | ||
|
||
@Override | ||
public void submitOfflineJob(String groupId, List<InlongStreamInfo> streamInfoList) throws Exception { | ||
submitFlinkJobs(groupId, streamInfoList); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...e/src/main/java/org/apache/inlong/manager/service/schedule/OfflineJobOperatorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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.inlong.manager.service.schedule; | ||
|
||
import org.apache.inlong.manager.common.exceptions.BusinessException; | ||
import org.apache.inlong.manager.workflow.processor.OfflineJobOperator; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class OfflineJobOperatorFactory { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(OfflineJobOperatorFactory.class); | ||
public static final String DEFAULT_OPERATOR_CLASS_NAME = | ||
"org.apache.inlong.manager.plugin.offline.FlinkOfflineJobOperator"; | ||
|
||
public static OfflineJobOperator getOfflineJobOperator() { | ||
return getOfflineJobOperator(DEFAULT_OPERATOR_CLASS_NAME); | ||
} | ||
|
||
public static OfflineJobOperator getOfflineJobOperator(String operatorClassName) { | ||
return getOfflineJobOperator(operatorClassName, Thread.currentThread().getContextClassLoader()); | ||
} | ||
|
||
public static OfflineJobOperator getOfflineJobOperator(String operatorClassName, ClassLoader classLoader) { | ||
try { | ||
Class<?> operatorClass = classLoader.loadClass(operatorClassName); | ||
Object operator = operatorClass.getDeclaredConstructor().newInstance(); | ||
return (OfflineJobOperator) operator; | ||
} catch (Throwable e) { | ||
log.error("Failed to get offline job operator: ", e); | ||
throw new BusinessException("Failed to get offline job operator: " + e.getMessage()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.