Skip to content

Commit

Permalink
prepare to push to github
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jun 25, 2023
1 parent e33d13c commit dc4fbe4
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 5 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,20 @@
* common 公共模型和组件工具
* connectors 连接器
* executors 执行器
* core 核心接口
* plugins 业务包

# 快速开始

> 本组件目前仅支持 jdbc 方式同步,快速开始使用 mysql 为例、本案例是同一个库的表-表同步示例,实际上使用了同一个表;建议您在测试中可以使用不同的表来进行区分
## 准备

* 目标数据库、表;schema 见:com.idata.plugin.jmlt.model.JmltModel
* 原始数据库、表;schema 见:com.idata.plugin.jmlt.model.StandardMdjfModel

## 用例
api-web 模块下有个 DataSyncExecutorTest 测试用例,以此为入口;在完成配置之后执行用例即可。



4 changes: 2 additions & 2 deletions api-web/src/test/java/com/idata/web/DataSyncExecutorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public void test_DataSyncExecutor() {
origin.setDatabase("glmapper");
origin.setUrl(url);
origin.setUsername("root");
origin.setPassword("glmapper@2018");
origin.setPassword("abc123");
ConnectorSourceConfigs.InnerSource target = new ConnectorSourceConfigs.InnerSource();
target.setDatabase("glmapper");
target.setUrl(url);
target.setUsername("root");
target.setPassword("glmapper@2018");
target.setPassword("abc123");

configs.setBizType("jmlt");
configs.setSourceType(SourceType.MYSQL57);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
* <p>
Expand All @@ -26,6 +27,16 @@ public class RowObjectEventHandler<T> implements EventHandler<RowObjectEvent> {

private DataSource targetDataSource;

AtomicInteger INCR = new AtomicInteger(1000);

public int getRandIncrNo() {
if (INCR.get() == 9999) {
INCR.set(1000);
}
return INCR.incrementAndGet();
}


public RowObjectEventHandler(DataSource targetDataSource) {
this.targetDataSource = targetDataSource;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.idata.plugin.jmlt;

import com.idata.common.model.StandardMdjfModel;
import com.idata.plugin.jmlt.model.StandardMdjfModel;
import com.idata.core.Convertor;
import com.idata.plugin.jmlt.model.JmltModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.idata.plugin.jmlt;

import com.idata.common.ConnectorSourceConfigs;
import com.idata.common.model.StandardMdjfModel;
import com.idata.plugin.jmlt.model.StandardMdjfModel;
import com.idata.connectors.mysql.MysqlConnector;
import com.idata.core.Connector;
import com.idata.core.Convertor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.idata.common.model;
package com.idata.plugin.jmlt.model;

import com.idata.common.annotations.Colum;
import com.idata.common.annotations.Table;
Expand Down

0 comments on commit dc4fbe4

Please sign in to comment.