|
22 | 22 | import org.apache.seatunnel.engine.common.config.server.ConnectorJarHAStorageConfig;
|
23 | 23 | import org.apache.seatunnel.engine.common.config.server.ConnectorJarStorageConfig;
|
24 | 24 | import org.apache.seatunnel.engine.common.config.server.ConnectorJarStorageMode;
|
| 25 | +import org.apache.seatunnel.engine.common.config.server.CoordinatorServiceConfig; |
25 | 26 | import org.apache.seatunnel.engine.common.config.server.HttpConfig;
|
26 | 27 | import org.apache.seatunnel.engine.common.config.server.QueueType;
|
27 | 28 | import org.apache.seatunnel.engine.common.config.server.ScheduleStrategy;
|
@@ -106,6 +107,25 @@ private SlotServiceConfig parseSlotServiceConfig(Node slotServiceNode) {
|
106 | 107 | return slotServiceConfig;
|
107 | 108 | }
|
108 | 109 |
|
| 110 | + private CoordinatorServiceConfig parseCoordinatorServiceConfig(Node coordinatorServiceNode) { |
| 111 | + CoordinatorServiceConfig coordinatorServiceConfig = new CoordinatorServiceConfig(); |
| 112 | + for (Node node : childElements(coordinatorServiceNode)) { |
| 113 | + String name = cleanNodeName(node); |
| 114 | + if (ServerConfigOptions.MAX_THREAD_NUM.key().equals(name)) { |
| 115 | + coordinatorServiceConfig.setMaxThreadNum( |
| 116 | + getIntegerValue( |
| 117 | + ServerConfigOptions.MAX_THREAD_NUM.key(), getTextContent(node))); |
| 118 | + } else if (ServerConfigOptions.CORE_THREAD_NUM.key().equals(name)) { |
| 119 | + coordinatorServiceConfig.setCoreThreadNum( |
| 120 | + getIntegerValue( |
| 121 | + ServerConfigOptions.CORE_THREAD_NUM.key(), getTextContent(node))); |
| 122 | + } else { |
| 123 | + LOGGER.warning("Unrecognized element: " + name); |
| 124 | + } |
| 125 | + } |
| 126 | + return coordinatorServiceConfig; |
| 127 | + } |
| 128 | + |
109 | 129 | private void parseEngineConfig(Node engineNode, SeaTunnelConfig config) {
|
110 | 130 | final EngineConfig engineConfig = config.getEngineConfig();
|
111 | 131 | for (Node node : childElements(engineNode)) {
|
@@ -177,6 +197,8 @@ private void parseEngineConfig(Node engineNode, SeaTunnelConfig config) {
|
177 | 197 | ScheduleStrategy.valueOf(getTextContent(node).toUpperCase(Locale.ROOT)));
|
178 | 198 | } else if (ServerConfigOptions.HTTP.key().equals(name)) {
|
179 | 199 | engineConfig.setHttpConfig(parseHttpConfig(node));
|
| 200 | + } else if (ServerConfigOptions.COORDINATOR_SERVICE.key().equals(name)) { |
| 201 | + engineConfig.setCoordinatorServiceConfig(parseCoordinatorServiceConfig(node)); |
180 | 202 | } else {
|
181 | 203 | LOGGER.warning("Unrecognized element: " + name);
|
182 | 204 | }
|
|
0 commit comments