修改canal.mq.partitionHash散列规则,

当指明pk级做分区(schema.table:pk1^pk2)时,由table.hashCode()^column.getValue().hashCode()改为database.hashCode()^column.getValue().hashCode(),从而支持同库下不同表hash至相同分区
This commit is contained in:
wangsaner
2019-03-28 16:01:02 +08:00
parent d6ef66a281
commit 9826948ebb

View File

@@ -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();