use of org.apache.rocketmq.connect.runtime.common.ConnectKeyValue in project rocketmq-externals by apache.
the class ConfigManagementServiceImpl method removeConnectorConfig.
@Override
public void removeConnectorConfig(String connectorName) {
ConnectKeyValue config = connectorKeyValueStore.get(connectorName);
config.put(RuntimeConfigDefine.UPDATE_TIMESTAMP, System.currentTimeMillis());
config.put(RuntimeConfigDefine.CONFIG_DELETED, 1);
List<ConnectKeyValue> taskConfigList = taskKeyValueStore.get(connectorName);
taskConfigList.add(config);
connectorKeyValueStore.put(connectorName, config);
putTaskConfigs(connectorName, taskConfigList);
log.info("[ISSUE #2027] After removal The configs are:\n" + getConnectorConfigs().toString());
sendSynchronizeConfig();
triggerListener();
}
use of org.apache.rocketmq.connect.runtime.common.ConnectKeyValue 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;
}
use of org.apache.rocketmq.connect.runtime.common.ConnectKeyValue in project rocketmq-externals by apache.
the class WorkerConnectorTest method testReconfigure.
@Test
public void testReconfigure() {
ConnectKeyValue connectKeyValue = new ConnectKeyValue();
connectKeyValue.put("test2", "value2");
workerConnector.reconfigure(connectKeyValue);
assertThat(workerConnector.getKeyValue().equals(connectKeyValue)).isEqualTo(true);
}
Aggregations