|
|
@ -31,6 +31,7 @@ import org.apache.dolphinscheduler.spi.classloader.ThreadContextClassLoader; |
|
|
|
import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer; |
|
|
|
import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer; |
|
|
|
import org.apache.dolphinscheduler.spi.params.base.PluginParams; |
|
|
|
import org.apache.dolphinscheduler.spi.params.base.PluginParams; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
@ -47,6 +48,11 @@ public class AlertPluginManager extends AbstractDolphinPluginManager { |
|
|
|
private final Map<String, AlertChannelFactory> alertChannelFactoryMap = new ConcurrentHashMap<>(); |
|
|
|
private final Map<String, AlertChannelFactory> alertChannelFactoryMap = new ConcurrentHashMap<>(); |
|
|
|
private final Map<String, AlertChannel> alertChannelMap = new ConcurrentHashMap<>(); |
|
|
|
private final Map<String, AlertChannel> alertChannelMap = new ConcurrentHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* k->pluginDefineId v->pluginDefineName |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static Map<Integer, String> pluginDefineMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
public void addAlertChannelFactory(AlertChannelFactory alertChannelFactory) { |
|
|
|
public void addAlertChannelFactory(AlertChannelFactory alertChannelFactory) { |
|
|
|
requireNonNull(alertChannelFactory, "alertChannelFactory is null"); |
|
|
|
requireNonNull(alertChannelFactory, "alertChannelFactory is null"); |
|
|
|
|
|
|
|
|
|
|
@ -93,7 +99,8 @@ public class AlertPluginManager extends AbstractDolphinPluginManager { |
|
|
|
String paramsJson = PluginParamsTransfer.transferParamsToJson(params); |
|
|
|
String paramsJson = PluginParamsTransfer.transferParamsToJson(params); |
|
|
|
|
|
|
|
|
|
|
|
PluginDefine pluginDefine = new PluginDefine(nameEn, PluginType.ALERT.getDesc(), paramsJson); |
|
|
|
PluginDefine pluginDefine = new PluginDefine(nameEn, PluginType.ALERT.getDesc(), paramsJson); |
|
|
|
pluginDao.addOrUpdatePluginDefine(pluginDefine); |
|
|
|
int id = pluginDao.addOrUpdatePluginDefine(pluginDefine); |
|
|
|
|
|
|
|
pluginDefineMap.put(id, pluginDefine.getPluginName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|