Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lijianghuflute
canal
提交
b82c8bca
canal
项目概览
lijianghuflute
/
canal
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
canal
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b82c8bca
编写于
8月 20, 2020
作者:
T
Tocker
提交者:
GitHub
8月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix:Alibaba Coding Guidelines-Object的equals方法容易抛空指针异常,应使用常量或确定有值的对象来调用equals。 (#2919)
上级
576406a4
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
23 addition
and
23 deletion
+23
-23
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/PropertiesConfigurationFactory.java
...t/adapter/config/bind/PropertiesConfigurationFactory.java
+1
-1
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java
...baba/otter/canal/client/adapter/support/JdbcTypeUtil.java
+1
-1
client-adapter/escore/src/main/java/com/alibaba/otter/canal/client/adapter/es/core/service/ESSyncService.java
...r/canal/client/adapter/es/core/service/ESSyncService.java
+3
-3
client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/config/MappingConfig.java
...tter/canal/client/adapter/hbase/config/MappingConfig.java
+1
-1
client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/service/HbaseSyncService.java
.../canal/client/adapter/hbase/service/HbaseSyncService.java
+3
-3
client-adapter/kudu/src/main/java/com/alibaba/otter/canal/client/adapter/kudu/service/KuduSyncService.java
...er/canal/client/adapter/kudu/service/KuduSyncService.java
+3
-3
client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/rest/CommonRest.java
...alibaba/otter/canal/adapter/launcher/rest/CommonRest.java
+2
-2
client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java
...tter/canal/client/adapter/rdb/service/RdbSyncService.java
+4
-4
client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/support/SyncUtil.java
...baba/otter/canal/client/adapter/rdb/support/SyncUtil.java
+1
-1
connector/core/src/main/java/com/alibaba/otter/canal/connector/core/producer/MQMessageUtils.java
...a/otter/canal/connector/core/producer/MQMessageUtils.java
+1
-1
connector/core/src/main/java/com/alibaba/otter/canal/connector/core/util/JdbcTypeUtil.java
...alibaba/otter/canal/connector/core/util/JdbcTypeUtil.java
+1
-1
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java
...baba/otter/canal/parse/inbound/mysql/MysqlConnection.java
+1
-1
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/request/DescribeBackupPolicyRequest.java
...nbound/mysql/rds/request/DescribeBackupPolicyRequest.java
+1
-1
未找到文件。
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/config/bind/PropertiesConfigurationFactory.java
浏览文件 @
b82c8bca
...
...
@@ -282,7 +282,7 @@ public class PropertiesConfigurationFactory<T> implements FactoryBean<T>, Applic
PropertyDescriptor
[]
descriptors
=
BeanUtils
.
getPropertyDescriptors
(
this
.
target
.
getClass
());
for
(
PropertyDescriptor
descriptor
:
descriptors
)
{
String
name
=
descriptor
.
getName
();
if
(!
name
.
equals
(
"class"
))
{
if
(!
"class"
.
equals
(
name
))
{
RelaxedNames
relaxedNames
=
RelaxedNames
.
forCamelCase
(
name
);
if
(
prefixes
==
null
)
{
for
(
String
relaxedName
:
relaxedNames
)
{
...
...
client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java
浏览文件 @
b82c8bca
...
...
@@ -78,7 +78,7 @@ public class JdbcTypeUtil {
public
static
Object
typeConvert
(
String
tableName
,
String
columnName
,
String
value
,
int
sqlType
,
String
mysqlType
)
{
if
(
value
==
null
||
(
value
.
equals
(
""
)
&&
!(
isText
(
mysqlType
)
||
sqlType
==
Types
.
CHAR
||
sqlType
==
Types
.
VARCHAR
||
sqlType
==
Types
.
LONGVARCHAR
)))
{
||
(
""
.
equals
(
value
)
&&
!(
isText
(
mysqlType
)
||
sqlType
==
Types
.
CHAR
||
sqlType
==
Types
.
VARCHAR
||
sqlType
==
Types
.
LONGVARCHAR
)))
{
return
null
;
}
...
...
client-adapter/escore/src/main/java/com/alibaba/otter/canal/client/adapter/es/core/service/ESSyncService.java
浏览文件 @
b82c8bca
...
...
@@ -95,11 +95,11 @@ public class ESSyncService {
long
begin
=
System
.
currentTimeMillis
();
String
type
=
dml
.
getType
();
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"INSERT"
))
{
if
(
type
!=
null
&&
"INSERT"
.
equalsIgnoreCase
(
type
))
{
insert
(
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"UPDATE"
))
{
}
else
if
(
type
!=
null
&&
"UPDATE"
.
equalsIgnoreCase
(
type
))
{
update
(
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"DELETE"
))
{
}
else
if
(
type
!=
null
&&
"DELETE"
.
equalsIgnoreCase
(
type
))
{
delete
(
config
,
dml
);
}
else
{
return
;
...
...
client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/config/MappingConfig.java
浏览文件 @
b82c8bca
...
...
@@ -312,7 +312,7 @@ public class MappingConfig implements AdapterConfig {
columnItem
.
setRowKey
(
true
);
rowKeyColumn
=
columnItem
;
}
else
{
if
(
field
==
null
||
field
.
equals
(
""
))
{
if
(
field
==
null
||
""
.
equals
(
field
))
{
columnItem
.
setFamily
(
family
);
columnItem
.
setQualifier
(
columnField
.
getKey
());
}
else
{
...
...
client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/service/HbaseSyncService.java
浏览文件 @
b82c8bca
...
...
@@ -31,11 +31,11 @@ public class HbaseSyncService {
public
void
sync
(
MappingConfig
config
,
Dml
dml
)
{
if
(
config
!=
null
)
{
String
type
=
dml
.
getType
();
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"INSERT"
))
{
if
(
type
!=
null
&&
"INSERT"
.
equalsIgnoreCase
(
type
))
{
insert
(
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"UPDATE"
))
{
}
else
if
(
type
!=
null
&&
"UPDATE"
.
equalsIgnoreCase
(
type
))
{
update
(
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"DELETE"
))
{
}
else
if
(
type
!=
null
&&
"DELETE"
.
equalsIgnoreCase
(
type
))
{
delete
(
config
,
dml
);
}
if
(
logger
.
isDebugEnabled
())
{
...
...
client-adapter/kudu/src/main/java/com/alibaba/otter/canal/client/adapter/kudu/service/KuduSyncService.java
浏览文件 @
b82c8bca
...
...
@@ -47,11 +47,11 @@ public class KuduSyncService {
public
void
sync
(
KuduMappingConfig
config
,
Dml
dml
)
{
if
(
config
!=
null
)
{
String
type
=
dml
.
getType
();
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"INSERT"
))
{
if
(
type
!=
null
&&
"INSERT"
.
equalsIgnoreCase
(
type
))
{
insert
(
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"UPDATE"
))
{
}
else
if
(
type
!=
null
&&
"UPDATE"
.
equalsIgnoreCase
(
type
))
{
upsert
(
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"DELETE"
))
{
}
else
if
(
type
!=
null
&&
"DELETE"
.
equalsIgnoreCase
(
type
))
{
delete
(
config
,
dml
);
}
if
(
logger
.
isDebugEnabled
())
{
...
...
client-adapter/launcher/src/main/java/com/alibaba/otter/canal/adapter/launcher/rest/CommonRest.java
浏览文件 @
b82c8bca
...
...
@@ -181,11 +181,11 @@ public class CommonRest {
*/
@PutMapping
(
"/syncSwitch/{destination}/{status}"
)
public
Result
etl
(
@PathVariable
String
destination
,
@PathVariable
String
status
)
{
if
(
status
.
equals
(
"on"
))
{
if
(
"on"
.
equals
(
status
))
{
syncSwitch
.
on
(
destination
);
logger
.
info
(
"#Destination: {} sync on"
,
destination
);
return
Result
.
createSuccess
(
"实例: "
+
destination
+
" 开启同步成功"
);
}
else
if
(
status
.
equals
(
"off"
))
{
}
else
if
(
"off"
.
equals
(
status
))
{
syncSwitch
.
off
(
destination
);
logger
.
info
(
"#Destination: {} sync off"
,
destination
);
return
Result
.
createSuccess
(
"实例: "
+
destination
+
" 关闭同步成功"
);
...
...
client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java
浏览文件 @
b82c8bca
...
...
@@ -208,13 +208,13 @@ public class RdbSyncService {
if
(
config
!=
null
)
{
try
{
String
type
=
dml
.
getType
();
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"INSERT"
))
{
if
(
type
!=
null
&&
"INSERT"
.
equalsIgnoreCase
(
type
))
{
insert
(
batchExecutor
,
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"UPDATE"
))
{
}
else
if
(
type
!=
null
&&
"UPDATE"
.
equalsIgnoreCase
(
type
))
{
update
(
batchExecutor
,
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"DELETE"
))
{
}
else
if
(
type
!=
null
&&
"DELETE"
.
equalsIgnoreCase
(
type
))
{
delete
(
batchExecutor
,
config
,
dml
);
}
else
if
(
type
!=
null
&&
type
.
equalsIgnoreCase
(
"TRUNCATE"
))
{
}
else
if
(
type
!=
null
&&
"TRUNCATE"
.
equalsIgnoreCase
(
type
))
{
truncate
(
batchExecutor
,
config
);
}
if
(
logger
.
isDebugEnabled
())
{
...
...
client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/support/SyncUtil.java
浏览文件 @
b82c8bca
...
...
@@ -71,7 +71,7 @@ public class SyncUtil {
if
(
value
instanceof
Boolean
)
{
pstmt
.
setBoolean
(
i
,
(
Boolean
)
value
);
}
else
if
(
value
instanceof
String
)
{
boolean
v
=
!
value
.
equals
(
"0"
);
boolean
v
=
!
"0"
.
equals
(
value
);
pstmt
.
setBoolean
(
i
,
v
);
}
else
if
(
value
instanceof
Number
)
{
boolean
v
=
((
Number
)
value
).
intValue
()
!=
0
;
...
...
connector/core/src/main/java/com/alibaba/otter/canal/connector/core/producer/MQMessageUtils.java
浏览文件 @
b82c8bca
...
...
@@ -49,7 +49,7 @@ public class MQMessageUtils {
int
i
=
pkHashConfig
.
lastIndexOf
(
":"
);
if
(
i
>
0
)
{
String
pkStr
=
pkHashConfig
.
substring
(
i
+
1
);
if
(
pkStr
.
equalsIgnoreCase
(
"$pk$"
))
{
if
(
"$pk$"
.
equalsIgnoreCase
(
pkStr
))
{
data
.
hashMode
.
autoPkHash
=
true
;
}
else
{
data
.
hashMode
.
pkNames
=
Lists
.
newArrayList
(
StringUtils
.
split
(
pkStr
,
...
...
connector/core/src/main/java/com/alibaba/otter/canal/connector/core/util/JdbcTypeUtil.java
浏览文件 @
b82c8bca
...
...
@@ -78,7 +78,7 @@ public class JdbcTypeUtil {
public
static
Object
typeConvert
(
String
tableName
,
String
columnName
,
String
value
,
int
sqlType
,
String
mysqlType
)
{
if
(
value
==
null
||
(
value
.
equals
(
""
)
&&
!(
isText
(
mysqlType
)
||
sqlType
==
Types
.
CHAR
||
sqlType
==
Types
.
VARCHAR
||
sqlType
==
Types
.
LONGVARCHAR
)))
{
||
(
""
.
equals
(
value
)
&&
!(
isText
(
mysqlType
)
||
sqlType
==
Types
.
CHAR
||
sqlType
==
Types
.
VARCHAR
||
sqlType
==
Types
.
LONGVARCHAR
)))
{
return
null
;
}
...
...
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java
浏览文件 @
b82c8bca
...
...
@@ -522,7 +522,7 @@ public class MysqlConnection implements ErosaConnection {
rs
=
query
(
"select @@global.binlog_checksum"
);
List
<
String
>
columnValues
=
rs
.
getFieldValues
();
if
(
columnValues
!=
null
&&
columnValues
.
size
()
>=
1
&&
columnValues
.
get
(
0
)
!=
null
&&
columnValues
.
get
(
0
).
toUpperCase
().
equals
(
"CRC32"
))
{
&&
"CRC32"
.
equals
(
columnValues
.
get
(
0
).
toUpperCase
()
))
{
binlogChecksum
=
LogEvent
.
BINLOG_CHECKSUM_ALG_CRC32
;
}
else
{
binlogChecksum
=
LogEvent
.
BINLOG_CHECKSUM_ALG_OFF
;
...
...
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/request/DescribeBackupPolicyRequest.java
浏览文件 @
b82c8bca
...
...
@@ -31,7 +31,7 @@ public class DescribeBackupPolicyRequest extends AbstractRequest<RdsBackupPolicy
JSONObject
jsonObj
=
JSON
.
parseObject
(
result
);
RdsBackupPolicy
policy
=
new
RdsBackupPolicy
();
policy
.
setBackupRetentionPeriod
(
jsonObj
.
getString
(
"BackupRetentionPeriod"
));
policy
.
setBackupLog
(
jsonObj
.
getString
(
"BackupLog"
).
equalsIgnoreCase
(
"Enable"
));
policy
.
setBackupLog
(
"Enable"
.
equalsIgnoreCase
(
jsonObj
.
getString
(
"BackupLog"
)
));
policy
.
setLogBackupRetentionPeriod
(
jsonObj
.
getIntValue
(
"LogBackupRetentionPeriod"
));
policy
.
setPreferredBackupPeriod
(
jsonObj
.
getString
(
"PreferredBackupPeriod"
));
policy
.
setPreferredBackupTime
(
jsonObj
.
getString
(
"PreferredBackupTime"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录