Skip to content

Commit

Permalink
[INLONG-10395][Manager] Add interface for schedule client and engine (#…
Browse files Browse the repository at this point in the history
…10397)

* [INLONG-10395][Manager] Add interface for schedule client and engine
  • Loading branch information
aloyszhang committed Jun 20, 2024
1 parent 8bd3a20 commit 4d5c873
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 0 deletions.
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.
* @param scheduleInfo schedule info to register
* */
boolean handleRegister(ScheduleInfo scheduleInfo);

/**
* Handle schedule unregister.
* @param scheduleInfo schedule info to unregister
* */
boolean handleUnregister(ScheduleInfo scheduleInfo);

/**
* Handle schedule update.
* @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);

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

/**
* Update schedule from schedule engine.
* @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

0 comments on commit 4d5c873

Please sign in to comment.