mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
= performance improve
- using bulk operation instead of iteration if possible - terminate loop after condition is met
This commit is contained in:
@@ -191,9 +191,7 @@ public class DatabaseTableMeta implements TableMetaTSDB {
|
|||||||
try {
|
try {
|
||||||
ResultSetPacket packet = connection.query("show databases");
|
ResultSetPacket packet = connection.query("show databases");
|
||||||
List<String> schemas = new ArrayList<>();
|
List<String> schemas = new ArrayList<>();
|
||||||
for (String schema : packet.getFieldValues()) {
|
schemas.addAll(packet.getFieldValues());
|
||||||
schemas.add(schema);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (String schema : schemas) {
|
for (String schema : schemas) {
|
||||||
// filter views
|
// filter views
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class HeartBeatEntryEventHandler extends AbstractCanalEventDownStreamHand
|
|||||||
for (Event event : events) {
|
for (Event event : events) {
|
||||||
if (event.getEntryType() == EntryType.HEARTBEAT) {
|
if (event.getEntryType() == EntryType.HEARTBEAT) {
|
||||||
existHeartBeat = true;
|
existHeartBeat = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user