Skip to content

Commit df50ec4

Browse files
committed
move BasicRateLimiter.java to tis-realtime-flink
1 parent a34ae31 commit df50ec4

11 files changed

Lines changed: 112 additions & 119 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
* 封装MySQL作为数据源的DataSource插件,可以向TIS导入MySQL中的数据表作后续分析处理
1+
封装MySQL作为数据源的DataSource插件,可以向TIS导入MySQL中的数据表作后续分析处理
22
* MysqlReader
3-
3+
44
MysqlReader插件实现了从Mysql读取数据。在底层实现上,MysqlReader通过JDBC连接远程Mysql数据库,并执行相应的sql语句将数据从mysql库中SELECT出来[详细](https://github.com/alibaba/DataX/blob/master/mysqlreader/doc/mysqlreader.md)
55

66
* MysqlWriter
77

8-
实现了Alibaba DataXWriter 插件,写入数据到 Mysql 主库的目的表的功能。在底层实现上, MysqlWriter 通过 JDBC 连接远程 Mysql 数据库,并执行相应的 insert into ... 或者 ( replace into ...) 的 sql 语句将数据写入 Mysql,内部会分批次提交入库,需要数据库本身采用 innodb 引擎。 [详细](https://github.com/alibaba/DataX/blob/master/mysqlwriter/doc/mysqlwriter.md)
8+
实现了Alibaba DataXWriter 插件,写入数据到 Mysql 主库的目的表的功能。在底层实现上, MysqlWriter 通过 JDBC 连接远程 Mysql 数据库,并执行相应的 insert into ... 或者 ( replace into ...) 的 sql 语句将数据写入 Mysql,内部会分批次提交入库,需要数据库本身采用 innodb 引擎。 [详细](https://github.com/alibaba/DataX/blob/master/mysqlwriter/doc/mysqlwriter.md)
9+
10+
* DorisReader
11+
实现了Apache Doris 批量读取数据功能

tis-incr/tis-flink-cdc-common/src/main/java/com/qlangtech/plugins/incr/flink/cdc/BasicRateLimiter.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

tis-incr/tis-flink-cdc-common/src/main/java/com/qlangtech/plugins/incr/flink/cdc/impl/NoRateLimiter.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

tis-incr/tis-flink-cdc-common/src/main/resources/com/qlangtech/plugins/incr/flink/cdc/impl/PerSecondRateLimiter.json renamed to tis-incr/tis-flink-cdc-common/src/main/resources/com/qlangtech/plugins/incr/flink/cdc/impl/PerSecondRateLimiter.json_bak

File renamed without changes.

tis-incr/tis-incr-test/src/main/java/com/qlangtech/plugins/incr/flink/cdc/CUDCDCTestSuit.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.google.common.collect.Maps;
2424
import com.qlangtech.plugins.incr.flink.cdc.RowValsExample.RowVal;
2525
import com.qlangtech.plugins.incr.flink.cdc.RowValsUpdate.UpdatedColVal;
26-
import com.qlangtech.plugins.incr.flink.cdc.impl.NoRateLimiter;
2726
import com.qlangtech.plugins.incr.flink.cdc.source.TestBasicFlinkSourceHandle;
2827
import com.qlangtech.plugins.incr.flink.launch.TISFlinkCDCStreamFactory;
2928
import com.qlangtech.tis.async.message.client.consumer.AsyncMsg;
@@ -50,12 +49,10 @@
5049
import com.qlangtech.tis.plugin.ds.ColumnMetaData;
5150
import com.qlangtech.tis.plugin.ds.DataSourceFactory;
5251
import com.qlangtech.tis.plugin.ds.DataSourceFactory.IConnProcessor;
53-
import com.qlangtech.tis.plugin.ds.DataSourceMeta;
5452
import com.qlangtech.tis.plugin.ds.IDataSourceDumper;
5553
import com.qlangtech.tis.plugin.ds.ISelectedTab;
5654
import com.qlangtech.tis.plugin.ds.JDBCConnection;
5755
import com.qlangtech.tis.plugin.ds.TableNotFoundException;
58-
import com.qlangtech.tis.plugin.incr.IncrStreamFactory;
5956
import com.qlangtech.tis.plugin.incr.TISSinkFactory;
6057
import com.qlangtech.tis.plugins.incr.flink.cdc.mysql.MySqlSourceTestBase;
6158
import com.qlangtech.tis.realtime.ReaderSource;
@@ -65,11 +62,9 @@
6562
import org.apache.commons.io.LineIterator;
6663
import org.apache.commons.lang.StringUtils;
6764
import org.apache.commons.lang3.tuple.Pair;
68-
import org.apache.flink.api.common.JobExecutionResult;
6965
import org.apache.flink.types.Row;
7066
import org.apache.flink.types.RowKind;
7167
import org.apache.flink.util.CloseableIterator;
72-
import org.jetbrains.annotations.NotNull;
7368
import org.junit.Assert;
7469

7570
import java.sql.Connection;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package com.qlangtech.plugins.incr.flink.cdc;
20+
21+
import com.qlangtech.tis.plugin.incr.TISRateLimiter;
22+
import org.apache.flink.api.connector.source.util.ratelimit.RateLimiterStrategy;
23+
24+
/**
25+
* @author: 百岁(baisui@qlangtech.com)
26+
* @create: 2025-07-06 12:18
27+
* @see NoRateLimiter
28+
* @see PerSecondRateLimiter
29+
**/
30+
public abstract class BasicRateLimiter extends TISRateLimiter {
31+
32+
@Override
33+
public abstract RateLimiterStrategy getStrategy();
34+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package com.qlangtech.plugins.incr.flink.cdc;
20+
21+
import com.qlangtech.tis.extension.Descriptor;
22+
import com.qlangtech.tis.extension.TISExtension;
23+
import com.qlangtech.tis.plugin.incr.TISRateLimiter;
24+
import org.apache.flink.api.connector.source.util.ratelimit.RateLimiterStrategy;
25+
26+
/**
27+
* 不支持运行期动态设置限流值
28+
*
29+
* @author: 百岁(baisui@qlangtech.com)
30+
* @create: 2025-07-06 12:34
31+
**/
32+
public class NoRateLimiter extends BasicRateLimiter {
33+
@Override
34+
public RateLimiterStrategy getStrategy() {
35+
throw new UnsupportedOperationException();
36+
}
37+
38+
@Override
39+
public boolean supportRateLimiter() {
40+
return false;
41+
}
42+
43+
@TISExtension
44+
public static class Desc extends Descriptor<TISRateLimiter> {
45+
public Desc() {
46+
super();
47+
}
48+
49+
@Override
50+
public String getDisplayName() {
51+
return SWITCH_OFF;
52+
}
53+
}
54+
}

tis-incr/tis-flink-cdc-common/src/main/java/com/qlangtech/plugins/incr/flink/cdc/impl/PerSecondRateLimiter.java renamed to tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/plugins/incr/flink/cdc/PerSecondRateLimiter.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
/**
2-
* Licensed to the Apache Software Foundation (ASF) under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. The ASF licenses this file
6-
* to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
9-
* <p>
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
* <p>
12-
* Unless required by applicable law or agreed to in writing, software
13-
* distributed under the License is distributed on an "AS IS" BASIS,
14-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
* See the License for the specific language governing permissions and
16-
* limitations under the License.
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
1717
*/
1818

19-
package com.qlangtech.plugins.incr.flink.cdc.impl;
19+
package com.qlangtech.plugins.incr.flink.cdc;
2020

2121
import com.alibaba.citrus.turbine.Context;
22-
import com.qlangtech.plugins.incr.flink.cdc.BasicRateLimiter;
22+
import com.qlangtech.plugins.incr.flink.cdc.impl.ResettableRateLimitStrategy;
2323
import com.qlangtech.tis.extension.Descriptor;
2424
import com.qlangtech.tis.extension.TISExtension;
2525
import com.qlangtech.tis.plugin.incr.TISRateLimiter;

tis-incr/tis-flink-cdc-common/src/main/java/com/qlangtech/plugins/incr/flink/cdc/impl/ResettableRateLimitStrategy.java renamed to tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/plugins/incr/flink/cdc/impl/ResettableRateLimitStrategy.java

File renamed without changes.

tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/plugins/incr/flink/launch/TISFlinkCDCStreamFactory.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import com.qlangtech.tis.coredefine.module.action.IFlinkIncrJobStatus;
2929
import com.qlangtech.tis.coredefine.module.action.TargetResName;
3030
import com.qlangtech.tis.datax.DataXName;
31-
import com.qlangtech.tis.datax.impl.DataxReader;
32-
import com.qlangtech.tis.datax.impl.DataxReader.BaseDataxReaderDescriptor;
3331
import com.qlangtech.tis.datax.impl.DataxWriter;
3432
import com.qlangtech.tis.datax.impl.DataxWriter.BaseDataxWriterDescriptor;
3533
import com.qlangtech.tis.datax.job.JobOrchestrateException;
@@ -45,7 +43,6 @@
4543
import com.qlangtech.tis.plugin.annotation.FormField;
4644
import com.qlangtech.tis.plugin.annotation.FormFieldType;
4745
import com.qlangtech.tis.plugin.annotation.Validator;
48-
import com.qlangtech.tis.plugin.datax.common.AutoCreateTable.BasicDescriptor;
4946
import com.qlangtech.tis.plugin.incr.IncrStreamFactory;
5047
import com.qlangtech.tis.plugin.incr.TISRateLimiter;
5148
import com.qlangtech.tis.plugin.incr.WatchPodLog;

0 commit comments

Comments
 (0)