use of org.apache.rocketmq.connect.runtime.common.ConnAndTaskConfigs in project rocketmq-externals by apache.
the class ConfigManagementServiceImpl method sendOnlineConfig.
private void sendOnlineConfig() {
ConnAndTaskConfigs configs = new ConnAndTaskConfigs();
configs.setConnectorConfigs(connectorKeyValueStore.getKVMap());
configs.setTaskConfigs(taskKeyValueStore.getKVMap());
dataSynchronizer.send(ConfigChangeEnum.ONLINE_KEY.name(), configs);
}
use of org.apache.rocketmq.connect.runtime.common.ConnAndTaskConfigs in project rocketmq-externals by apache.
the class ConfigManagementServiceImpl method sendSynchronizeConfig.
private void sendSynchronizeConfig() {
ConnAndTaskConfigs configs = new ConnAndTaskConfigs();
configs.setConnectorConfigs(connectorKeyValueStore.getKVMap());
configs.setTaskConfigs(taskKeyValueStore.getKVMap());
dataSynchronizer.send(ConfigChangeEnum.CONFIG_CHANG_KEY.name(), configs);
}
use of org.apache.rocketmq.connect.runtime.common.ConnAndTaskConfigs in project rocketmq-externals by apache.
the class TransferUtils method toConnAndTaskConfigs.
public static ConnAndTaskConfigs toConnAndTaskConfigs(String json) {
JSONObject jsonObject = JSON.parseObject(json, JSONObject.class);
Map<String, String> connectorConfigs = (Map<String, String>) jsonObject.getObject("connector", Map.class);
Map<String, String> taskConfigs = (Map<String, String>) jsonObject.getObject("task", Map.class);
Map<String, ConnectKeyValue> transferedConnectorConfigs = new HashMap<>();
for (String key : connectorConfigs.keySet()) {
transferedConnectorConfigs.put(key, stringToKeyValue(connectorConfigs.get(key)));
}
Map<String, List<ConnectKeyValue>> transferedTasksConfigs = new HashMap<>();
for (String key : taskConfigs.keySet()) {
transferedTasksConfigs.put(key, stringToKeyValueList(taskConfigs.get(key)));
}
ConnAndTaskConfigs res = new ConnAndTaskConfigs();
res.setConnectorConfigs(transferedConnectorConfigs);
res.setTaskConfigs(transferedTasksConfigs);
return res;
}
Aggregations