mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
修改canal.mq.partitionHash散列规则,
当指明pk级做分区(schema.table:pk1^pk2)时,由table.hashCode()^column.getValue().hashCode()改为database.hashCode()^column.getValue().hashCode(),从而支持同库下不同表hash至相同分区
This commit is contained in:
@@ -230,6 +230,7 @@ public class MQMessageUtils {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hashCode = database.hashCode();
|
||||
for (CanalEntry.Column column : rowData.getAfterColumnsList()) {
|
||||
if (checkPkNamesHasContain(hashMode.pkNames, column.getName())) {
|
||||
hashCode = hashCode ^ column.getValue().hashCode();
|
||||
|
||||
Reference in New Issue
Block a user