Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG-10395][Manager] Add interface for schedule client and engine #10397

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions inlong-manager/manager-schedule/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.inlong</groupId>
<artifactId>inlong-manager</artifactId>
<version>1.13.0-SNAPSHOT</version>
</parent>

<artifactId>manager-schedule</artifactId>

<properties>
<inlong.root.dir>${project.parent.parent.basedir}</inlong.root.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.inlong</groupId>
<artifactId>manager-pojo</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* 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.schedule;

import org.apache.inlong.manager.pojo.schedule.ScheduleInfo;

/**
* Build-in schedule engine, provides basic schedule capabilities.
* */
public interface ScheduleEngine {

/**
* Start schedule engine.
* */
void start();

/**
* handle schedule register.
aloyszhang marked this conversation as resolved.
Show resolved Hide resolved
* @param scheduleInfo schedule info to register
* */
boolean handleRegister(ScheduleInfo scheduleInfo);

/**
* handle schedule unregister.
aloyszhang marked this conversation as resolved.
Show resolved Hide resolved
* @param scheduleInfo schedule info to unregister
* */
boolean handleUnregister(ScheduleInfo scheduleInfo);

/**
* handle schedule update.
aloyszhang marked this conversation as resolved.
Show resolved Hide resolved
* @param scheduleInfo schedule info to update
* */
boolean handleUpdate(ScheduleInfo scheduleInfo);

/**
* Stop schedule engine.
* */
void stop();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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.schedule;

import org.apache.inlong.manager.pojo.schedule.ScheduleInfo;

/**
* Interface for schedule engine client which responses for communicating with schedule engine.
* */
public interface ScheduleEngineClient {

/**
* register schedule to schedule engine.
* @param scheduleInfo schedule info to register
* */
boolean register(ScheduleInfo scheduleInfo);

/**
* unregister schedule from schedule engine.
* @param scheduleInfo schedule info to unregister
* */
boolean unregister(ScheduleInfo scheduleInfo);

/**
* update schedule from schedule engine.
aloyszhang marked this conversation as resolved.
Show resolved Hide resolved
* @param scheduleInfo schedule info to update
* */
boolean update(ScheduleInfo scheduleInfo);

}
1 change: 1 addition & 0 deletions inlong-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<module>manager-workflow</module>
<module>manager-web</module>
<module>manager-docker</module>
<module>manager-schedule</module>
</modules>

<properties>
Expand Down
Loading