3737import com .xiaojukeji .know .streaming .km .core .service .cluster .ClusterPhyService ;
3838import com .xiaojukeji .know .streaming .km .core .service .connect .cluster .ConnectClusterService ;
3939import com .xiaojukeji .know .streaming .km .core .service .connect .connector .ConnectorService ;
40+ import com .xiaojukeji .know .streaming .km .core .service .connect .connector .OpConnectorService ;
4041import com .xiaojukeji .know .streaming .km .core .service .connect .mm2 .MirrorMakerMetricService ;
4142import com .xiaojukeji .know .streaming .km .core .service .connect .plugin .PluginService ;
4243import com .xiaojukeji .know .streaming .km .core .service .connect .worker .WorkerConnectorService ;
@@ -67,6 +68,9 @@ public class MirrorMakerManagerImpl implements MirrorMakerManager {
6768 @ Autowired
6869 private ConnectorService connectorService ;
6970
71+ @ Autowired
72+ private OpConnectorService opConnectorService ;
73+
7074 @ Autowired
7175 private WorkerConnectorService workerConnectorService ;
7276
@@ -156,20 +160,20 @@ public Result<Void> deleteMirrorMaker(Long connectClusterId, String sourceConnec
156160
157161 Result <Void > rv = Result .buildSuc ();
158162 if (!ValidateUtils .isBlank (connectorPO .getCheckpointConnectorName ())) {
159- rv = connectorService .deleteConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
163+ rv = opConnectorService .deleteConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
160164 }
161165 if (rv .failed ()) {
162166 return rv ;
163167 }
164168
165169 if (!ValidateUtils .isBlank (connectorPO .getHeartbeatConnectorName ())) {
166- rv = connectorService .deleteConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
170+ rv = opConnectorService .deleteConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
167171 }
168172 if (rv .failed ()) {
169173 return rv ;
170174 }
171175
172- return connectorService .deleteConnector (connectClusterId , sourceConnectorName , operator );
176+ return opConnectorService .deleteConnector (connectClusterId , sourceConnectorName , operator );
173177 }
174178
175179 @ Override
@@ -181,20 +185,20 @@ public Result<Void> modifyMirrorMakerConfig(MirrorMakerCreateDTO dto, String ope
181185
182186 Result <Void > rv = Result .buildSuc ();
183187 if (!ValidateUtils .isBlank (connectorPO .getCheckpointConnectorName ()) && dto .getCheckpointConnectorConfigs () != null ) {
184- rv = connectorService .updateConnectorConfig (dto .getConnectClusterId (), connectorPO .getCheckpointConnectorName (), dto .getCheckpointConnectorConfigs (), operator );
188+ rv = opConnectorService .updateConnectorConfig (dto .getConnectClusterId (), connectorPO .getCheckpointConnectorName (), dto .getCheckpointConnectorConfigs (), operator );
185189 }
186190 if (rv .failed ()) {
187191 return rv ;
188192 }
189193
190194 if (!ValidateUtils .isBlank (connectorPO .getHeartbeatConnectorName ()) && dto .getHeartbeatConnectorConfigs () != null ) {
191- rv = connectorService .updateConnectorConfig (dto .getConnectClusterId (), connectorPO .getHeartbeatConnectorName (), dto .getHeartbeatConnectorConfigs (), operator );
195+ rv = opConnectorService .updateConnectorConfig (dto .getConnectClusterId (), connectorPO .getHeartbeatConnectorName (), dto .getHeartbeatConnectorConfigs (), operator );
192196 }
193197 if (rv .failed ()) {
194198 return rv ;
195199 }
196200
197- return connectorService .updateConnectorConfig (dto .getConnectClusterId (), dto .getConnectorName (), dto .getSuitableConfig (), operator );
201+ return opConnectorService .updateConnectorConfig (dto .getConnectClusterId (), dto .getConnectorName (), dto .getSuitableConfig (), operator );
198202 }
199203
200204 @ Override
@@ -206,20 +210,20 @@ public Result<Void> restartMirrorMaker(Long connectClusterId, String sourceConne
206210
207211 Result <Void > rv = Result .buildSuc ();
208212 if (!ValidateUtils .isBlank (connectorPO .getCheckpointConnectorName ())) {
209- rv = connectorService .restartConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
213+ rv = opConnectorService .restartConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
210214 }
211215 if (rv .failed ()) {
212216 return rv ;
213217 }
214218
215219 if (!ValidateUtils .isBlank (connectorPO .getHeartbeatConnectorName ())) {
216- rv = connectorService .restartConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
220+ rv = opConnectorService .restartConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
217221 }
218222 if (rv .failed ()) {
219223 return rv ;
220224 }
221225
222- return connectorService .restartConnector (connectClusterId , sourceConnectorName , operator );
226+ return opConnectorService .restartConnector (connectClusterId , sourceConnectorName , operator );
223227 }
224228
225229 @ Override
@@ -231,20 +235,20 @@ public Result<Void> stopMirrorMaker(Long connectClusterId, String sourceConnecto
231235
232236 Result <Void > rv = Result .buildSuc ();
233237 if (!ValidateUtils .isBlank (connectorPO .getCheckpointConnectorName ())) {
234- rv = connectorService .stopConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
238+ rv = opConnectorService .stopConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
235239 }
236240 if (rv .failed ()) {
237241 return rv ;
238242 }
239243
240244 if (!ValidateUtils .isBlank (connectorPO .getHeartbeatConnectorName ())) {
241- rv = connectorService .stopConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
245+ rv = opConnectorService .stopConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
242246 }
243247 if (rv .failed ()) {
244248 return rv ;
245249 }
246250
247- return connectorService .stopConnector (connectClusterId , sourceConnectorName , operator );
251+ return opConnectorService .stopConnector (connectClusterId , sourceConnectorName , operator );
248252 }
249253
250254 @ Override
@@ -256,20 +260,20 @@ public Result<Void> resumeMirrorMaker(Long connectClusterId, String sourceConnec
256260
257261 Result <Void > rv = Result .buildSuc ();
258262 if (!ValidateUtils .isBlank (connectorPO .getCheckpointConnectorName ())) {
259- rv = connectorService .resumeConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
263+ rv = opConnectorService .resumeConnector (connectClusterId , connectorPO .getCheckpointConnectorName (), operator );
260264 }
261265 if (rv .failed ()) {
262266 return rv ;
263267 }
264268
265269 if (!ValidateUtils .isBlank (connectorPO .getHeartbeatConnectorName ())) {
266- rv = connectorService .resumeConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
270+ rv = opConnectorService .resumeConnector (connectClusterId , connectorPO .getHeartbeatConnectorName (), operator );
267271 }
268272 if (rv .failed ()) {
269273 return rv ;
270274 }
271275
272- return connectorService .resumeConnector (connectClusterId , sourceConnectorName , operator );
276+ return opConnectorService .resumeConnector (connectClusterId , sourceConnectorName , operator );
273277 }
274278
275279 @ Override
0 commit comments