mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed plugin
This commit is contained in:
@@ -137,7 +137,7 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<includeClassifiers>jar-with-dependencies</includeClassifiers>
|
<includeClassifiers>jar-with-dependencies</includeClassifiers>
|
||||||
<outputDirectory>${project.basedir}/target/canal-adapter/lib</outputDirectory>
|
<outputDirectory>${project.basedir}/target/canal-adapter/plugin</outputDirectory>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|||||||
@@ -6,36 +6,36 @@
|
|||||||
</formats>
|
</formats>
|
||||||
<includeBaseDirectory>false</includeBaseDirectory>
|
<includeBaseDirectory>false</includeBaseDirectory>
|
||||||
<fileSets>
|
<fileSets>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>.</directory>
|
<directory>.</directory>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>README*</include>
|
<include>README*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>./src/main/bin</directory>
|
<directory>./src/main/bin</directory>
|
||||||
<outputDirectory>bin</outputDirectory>
|
<outputDirectory>bin</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>**/*</include>
|
<include>**/*</include>
|
||||||
</includes>
|
</includes>
|
||||||
<fileMode>0755</fileMode>
|
<fileMode>0755</fileMode>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>./src/main/resources</directory>
|
<directory>./src/main/resources</directory>
|
||||||
<outputDirectory>/conf</outputDirectory>
|
<outputDirectory>/conf</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>**/*</include>
|
<include>**/*</include>
|
||||||
|
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>../elasticsearch/src/main/resources/es</directory>
|
<directory>../elasticsearch/src/main/resources/es</directory>
|
||||||
<outputDirectory>/conf/es</outputDirectory>
|
<outputDirectory>/conf/es</outputDirectory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>**/*</include>
|
<include>**/*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>../hbase/src/main/resources/hbase</directory>
|
<directory>../hbase/src/main/resources/hbase</directory>
|
||||||
<outputDirectory>/conf/hbase</outputDirectory>
|
<outputDirectory>/conf/hbase</outputDirectory>
|
||||||
@@ -43,27 +43,31 @@
|
|||||||
<include>**/*</include>
|
<include>**/*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>../rdb/src/main/resources/</directory>
|
<directory>../rdb/src/main/resources/</directory>
|
||||||
<outputDirectory>/conf</outputDirectory>
|
<outputDirectory>/conf</outputDirectory>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>META-INF/**</exclude>
|
<exclude>META-INF/**</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>target</directory>
|
<directory>target</directory>
|
||||||
<outputDirectory>logs</outputDirectory>
|
<outputDirectory>logs</outputDirectory>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/*</exclude>
|
<exclude>**/*</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
</fileSets>
|
<fileSet>
|
||||||
<dependencySets>
|
<directory>${project.basedir}/target/canal-adapter/plugin</directory>
|
||||||
<dependencySet>
|
<outputDirectory>/plugin/</outputDirectory>
|
||||||
<outputDirectory>lib</outputDirectory>
|
</fileSet>
|
||||||
<excludes>
|
</fileSets>
|
||||||
<exclude>junit:junit</exclude>
|
<dependencySets>
|
||||||
</excludes>
|
<dependencySet>
|
||||||
</dependencySet>
|
<outputDirectory>lib</outputDirectory>
|
||||||
</dependencySets>
|
<excludes>
|
||||||
|
<exclude>junit:junit</exclude>
|
||||||
|
</excludes>
|
||||||
|
</dependencySet>
|
||||||
|
</dependencySets>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
|||||||
@@ -58,13 +58,9 @@
|
|||||||
<exclude>**/*</exclude>
|
<exclude>**/*</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
|
|
||||||
<fileSet>
|
<fileSet>
|
||||||
<directory>${project.basedir}/target/canal-adapter/lib</directory>
|
<directory>${project.basedir}/target/canal-adapter/plugin</directory>
|
||||||
<outputDirectory>/lib/</outputDirectory>
|
<outputDirectory>/plugin/</outputDirectory>
|
||||||
<includes>
|
|
||||||
<include>*-jar-with-dependencies.jar</include>
|
|
||||||
</includes>
|
|
||||||
</fileSet>
|
</fileSet>
|
||||||
</fileSets>
|
</fileSets>
|
||||||
<dependencySets>
|
<dependencySets>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if "%OS%" == "Windows_NT" set ENV_PATH=%~dp0%
|
|||||||
set conf_dir=%ENV_PATH%\..\conf
|
set conf_dir=%ENV_PATH%\..\conf
|
||||||
|
|
||||||
set CLASSPATH=%conf_dir%
|
set CLASSPATH=%conf_dir%
|
||||||
set CLASSPATH=%conf_dir%\..\lib\*;%CLASSPATH%
|
set CLASSPATH=%conf_dir%\..\lib\*;%conf_dir%\..\plugin\*;%CLASSPATH%
|
||||||
|
|
||||||
set JAVA_MEM_OPTS= -Xms128m -Xmx512m -XX:PermSize=128m
|
set JAVA_MEM_OPTS= -Xms128m -Xmx512m -XX:PermSize=128m
|
||||||
set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8
|
set JAVA_OPTS_EXT= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dapplication.codeset=UTF-8 -Dfile.encoding=UTF-8
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ ADAPTER_OPTS="-DappName=canal-adapter"
|
|||||||
for i in $base/lib/*;
|
for i in $base/lib/*;
|
||||||
do CLASSPATH=$i:"$CLASSPATH";
|
do CLASSPATH=$i:"$CLASSPATH";
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for i in $base/plugin/*;
|
||||||
|
do CLASSPATH=$i:"$CLASSPATH";
|
||||||
|
done
|
||||||
CLASSPATH="$base/conf:$CLASSPATH";
|
CLASSPATH="$base/conf:$CLASSPATH";
|
||||||
|
|
||||||
echo "cd to $bin_abs_path for workaround relative path"
|
echo "cd to $bin_abs_path for workaround relative path"
|
||||||
|
|||||||
@@ -646,15 +646,16 @@ public class LogEventConvert extends AbstractCanalLifeCycle implements BinlogPar
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldMeta != null && existOptionalMetaData) {
|
if (fieldMeta != null && existOptionalMetaData && tableMetaCache.isOnTSDB()) {
|
||||||
// check column info
|
// check column info
|
||||||
boolean check = StringUtils.equalsIgnoreCase(fieldMeta.getColumnName(), info.name);
|
boolean check = StringUtils.equalsIgnoreCase(fieldMeta.getColumnName(), info.name);
|
||||||
check &= (fieldMeta.isUnsigned() == info.unsigned);
|
check &= (fieldMeta.isUnsigned() == info.unsigned);
|
||||||
check &= (fieldMeta.isNullable() == info.nullable);
|
check &= (fieldMeta.isNullable() == info.nullable);
|
||||||
|
|
||||||
if (!check) {
|
if (!check) {
|
||||||
throw new CanalParseException("MySQL8.0 unmatch column metadata & pls submit issue , db : "
|
throw new CanalParseException("MySQL8.0 unmatch column metadata & pls submit issue , table : "
|
||||||
+ fieldMeta.toString() + " , binlog : " + info.toString()
|
+ tableMeta.getFullName() + ", db fieldMeta : "
|
||||||
|
+ fieldMeta.toString() + " , binlog fieldMeta : " + info.toString()
|
||||||
+ " , on : " + event.getHeader().getLogFileName() + ":"
|
+ " , on : " + event.getHeader().getLogFileName() + ":"
|
||||||
+ event.getHeader().getLogPos());
|
+ event.getHeader().getLogPos());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class TableMetaCache {
|
|||||||
public static final String EXTRA = "EXTRA";
|
public static final String EXTRA = "EXTRA";
|
||||||
private MysqlConnection connection;
|
private MysqlConnection connection;
|
||||||
private boolean isOnRDS = false;
|
private boolean isOnRDS = false;
|
||||||
|
private boolean isOnTSDB = false;
|
||||||
|
|
||||||
private TableMetaTSDB tableMetaTSDB;
|
private TableMetaTSDB tableMetaTSDB;
|
||||||
// 第一层tableId,第二层schema.table,解决tableId重复,对应多张表
|
// 第一层tableId,第二层schema.table,解决tableId重复,对应多张表
|
||||||
@@ -67,6 +68,8 @@ public class TableMetaCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
isOnTSDB = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -244,6 +247,15 @@ public class TableMetaCache {
|
|||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isOnTSDB() {
|
||||||
|
return isOnTSDB;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnTSDB(boolean isOnTSDB) {
|
||||||
|
this.isOnTSDB = isOnTSDB;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isOnRDS() {
|
public boolean isOnRDS() {
|
||||||
return isOnRDS;
|
return isOnRDS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user