|
18 | 18 |
|
19 | 19 | package org.apache.skywalking.oap.server.ai.pipeline; |
20 | 20 |
|
| 21 | +import org.apache.skywalking.oap.server.ai.pipeline.services.BaselineQueryService; |
| 22 | +import org.apache.skywalking.oap.server.ai.pipeline.services.BaselineQueryServiceImpl; |
21 | 23 | import org.apache.skywalking.oap.server.ai.pipeline.services.HttpUriRecognitionService; |
22 | | -import org.apache.skywalking.oap.server.ai.pipeline.services.api.HttpUriRecognition; |
| 24 | +import org.apache.skywalking.oap.server.core.CoreModule; |
| 25 | +import org.apache.skywalking.oap.server.core.config.group.EndpointNameGroupService; |
23 | 26 | import org.apache.skywalking.oap.server.library.module.ModuleConfig; |
24 | 27 | import org.apache.skywalking.oap.server.library.module.ModuleDefine; |
25 | 28 | import org.apache.skywalking.oap.server.library.module.ModuleProvider; |
@@ -56,25 +59,31 @@ public void onInitialized(final AIPipelineConfig initialized) { |
56 | 59 |
|
57 | 60 | @Override |
58 | 61 | public void prepare() throws ServiceNotProvidedException, ModuleStartException { |
59 | | - final HttpUriRecognitionService httpUriRecognitionService = new HttpUriRecognitionService( |
60 | | - aiPipelineConfig.getUriRecognitionServerAddr(), |
61 | | - aiPipelineConfig.getUriRecognitionServerPort() |
62 | | - ); |
63 | | - this.registerServiceImplementation(HttpUriRecognition.class, httpUriRecognitionService); |
| 62 | + this.registerServiceImplementation(BaselineQueryService.class, new BaselineQueryServiceImpl( |
| 63 | + aiPipelineConfig.getBaselineServerAddr(), |
| 64 | + aiPipelineConfig.getBaselineServerPort() |
| 65 | + )); |
64 | 66 | } |
65 | 67 |
|
66 | 68 | @Override |
67 | 69 | public void start() throws ServiceNotProvidedException, ModuleStartException { |
68 | | - |
| 70 | + final HttpUriRecognitionService httpUriRecognitionService = new HttpUriRecognitionService( |
| 71 | + aiPipelineConfig.getUriRecognitionServerAddr(), |
| 72 | + aiPipelineConfig.getUriRecognitionServerPort() |
| 73 | + ); |
| 74 | + getManager().find(CoreModule.NAME).provider() |
| 75 | + .getService(EndpointNameGroupService.class) |
| 76 | + .startHttpUriRecognitionSvr(httpUriRecognitionService); |
69 | 77 | } |
70 | 78 |
|
71 | 79 | @Override |
72 | 80 | public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException { |
73 | | - |
74 | 81 | } |
75 | 82 |
|
76 | 83 | @Override |
77 | 84 | public String[] requiredModules() { |
78 | | - return new String[0]; |
| 85 | + return new String[] { |
| 86 | + CoreModule.NAME |
| 87 | + }; |
79 | 88 | } |
80 | 89 | } |
0 commit comments