mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
ETL整个destination,同步开关无效的问题
This commit is contained in:
@@ -67,10 +67,18 @@ public class CommonRest {
|
|||||||
try {
|
try {
|
||||||
OuterAdapter adapter = loader.getExtension(type);
|
OuterAdapter adapter = loader.getExtension(type);
|
||||||
String destination = adapter.getDestination(task);
|
String destination = adapter.getDestination(task);
|
||||||
Boolean oriSwithcStatus = null;
|
Boolean oriSwitchStatus;
|
||||||
if (destination != null) {
|
if (destination != null) {
|
||||||
oriSwithcStatus = syncSwitch.status(destination);
|
oriSwitchStatus = syncSwitch.status(destination);
|
||||||
syncSwitch.off(destination);
|
if (oriSwitchStatus != null && oriSwitchStatus) {
|
||||||
|
syncSwitch.off(destination);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// task可能为destination,直接锁task
|
||||||
|
oriSwitchStatus = syncSwitch.status(task);
|
||||||
|
if (oriSwitchStatus != null && oriSwitchStatus) {
|
||||||
|
syncSwitch.off(task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
List<String> paramArr = null;
|
List<String> paramArr = null;
|
||||||
@@ -80,8 +88,10 @@ public class CommonRest {
|
|||||||
}
|
}
|
||||||
return adapter.etl(task, paramArr);
|
return adapter.etl(task, paramArr);
|
||||||
} finally {
|
} finally {
|
||||||
if (destination != null && oriSwithcStatus != null && oriSwithcStatus) {
|
if (destination != null && oriSwitchStatus != null && oriSwitchStatus) {
|
||||||
syncSwitch.on(destination);
|
syncSwitch.on(destination);
|
||||||
|
} else if (destination == null && oriSwitchStatus != null && oriSwitchStatus) {
|
||||||
|
syncSwitch.on(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user