mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
修改adapter打包,启动方式
This commit is contained in:
@@ -99,11 +99,11 @@ public class ESSyncConfigLoader {
|
||||
InputStream in = null;
|
||||
try {
|
||||
// 先取本地文件,再取类路径
|
||||
File configFile = new File("config/" + config);
|
||||
File configFile = new File("../config/" + config);
|
||||
if (configFile.exists()) {
|
||||
in = new FileInputStream(configFile);
|
||||
} else {
|
||||
in = ESSyncConfigLoader.class.getClassLoader().getResourceAsStream(config);
|
||||
in = ESSyncConfigLoader.class.getClassLoader().getResourceAsStream(config);
|
||||
}
|
||||
if (in == null) {
|
||||
throw new RuntimeException("Config file: " + config + " not found.");
|
||||
|
||||
@@ -9,6 +9,7 @@ import javax.sql.DataSource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.otter.canal.client.adapter.es.config.ESSyncConfig;
|
||||
import com.alibaba.otter.canal.client.adapter.es.config.ESSyncConfig.ESMapping;
|
||||
import com.alibaba.otter.canal.client.adapter.es.config.ESSyncConfigLoader;
|
||||
@@ -38,9 +39,6 @@ public class ESSyncService {
|
||||
}
|
||||
|
||||
public void sync(Dml dml) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("DML: {}", dml.toString());
|
||||
}
|
||||
long begin = System.currentTimeMillis();
|
||||
String database = dml.getDatabase();
|
||||
String table = dml.getTable();
|
||||
@@ -74,6 +72,9 @@ public class ESSyncService {
|
||||
esSyncConfigs.size(),
|
||||
dml.getDestination());
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("DML: {}", JSON.toJSONString(dml));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user