-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INLONG-11624][Agent] Add SQL data source (#11625)
* [INLONG-11624][Agent] Add SQL data source * [INLONG-11624][Agent] Add code comments * Update inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/instance/SQLInstance.java Co-authored-by: AloysZhang <[email protected]> * Update inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java Co-authored-by: AloysZhang <[email protected]> * Update inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java Co-authored-by: AloysZhang <[email protected]> * Update inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/regex/FileTask.java Co-authored-by: AloysZhang <[email protected]> * Update inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/regex/FileTask.java Co-authored-by: AloysZhang <[email protected]> * [INLONG-11624][Agent] Modify code based on comments * Update inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/SQLSource.java Co-authored-by: fuweng11 <[email protected]> * [INLONG-11624][Agent] Modify thread name * [INLONG-11624][Agent] Rename variables to prevent misunderstandings --------- Co-authored-by: AloysZhang <[email protected]> Co-authored-by: fuweng11 <[email protected]>
- Loading branch information
1 parent
cd2a0a2
commit b91a380
Showing
20 changed files
with
1,166 additions
and
849 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
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
62 changes: 62 additions & 0 deletions
62
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/pojo/SQLTask.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,62 @@ | ||
/* | ||
* 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.agent.pojo; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class SQLTask { | ||
|
||
private Integer id; | ||
private String sql; | ||
private String cycleUnit; | ||
private Boolean retry; | ||
private String dataTimeFrom; | ||
private String dataTimeTo; | ||
private String timeOffset; | ||
// The number of instances that can run simultaneously for this task to | ||
// prevent other problems caused by running too many instances simultaneously | ||
private Integer maxInstanceCount; | ||
private String jdbcUrl; | ||
private String username; | ||
private String jdbcPassword; | ||
private String dataSeparator; | ||
// The number of rows collected from the data source in each batch | ||
private Integer fetchSize; | ||
|
||
@Data | ||
public static class SQLTaskConfig { | ||
|
||
private String sql; | ||
private String cycleUnit; | ||
private Boolean retry; | ||
private String dataTimeFrom; | ||
private String dataTimeTo; | ||
// '1m' means one minute after, '-1m' means one minute before | ||
// '1h' means one hour after, '-1h' means one hour before | ||
// '1d' means one day after, '-1d' means one day before | ||
// Null means from current timestamp | ||
private String timeOffset; | ||
private Integer maxInstanceCount; | ||
private String jdbcUrl; | ||
private String username; | ||
private String jdbcPassword; | ||
private String dataSeparator; | ||
private Integer fetchSize; | ||
} | ||
} |
Oops, something went wrong.