|
31 | 31 | import org.apache.seatunnel.engine.server.rest.servlet.EncryptConfigServlet;
|
32 | 32 | import org.apache.seatunnel.engine.server.rest.servlet.FinishedJobsServlet;
|
33 | 33 | import org.apache.seatunnel.engine.server.rest.servlet.JobInfoServlet;
|
| 34 | +import org.apache.seatunnel.engine.server.rest.servlet.MetricsServlet; |
34 | 35 | import org.apache.seatunnel.engine.server.rest.servlet.OverviewServlet;
|
35 | 36 | import org.apache.seatunnel.engine.server.rest.servlet.RunningJobsServlet;
|
36 | 37 | import org.apache.seatunnel.engine.server.rest.servlet.RunningThreadsServlet;
|
|
53 | 54 | import java.net.URL;
|
54 | 55 | import java.util.EnumSet;
|
55 | 56 |
|
56 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.ENCRYPT_CONFIG; |
57 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.FINISHED_JOBS_INFO; |
58 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.GET_ALL_LOG_NAME; |
59 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.GET_LOG; |
60 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.GET_LOGS; |
61 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.JOB_INFO_URL; |
62 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.OVERVIEW; |
63 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.RUNNING_JOBS_URL; |
64 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.RUNNING_JOB_URL; |
65 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.RUNNING_THREADS; |
66 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.STOP_JOBS_URL; |
67 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.STOP_JOB_URL; |
68 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.SUBMIT_JOBS_URL; |
69 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.SUBMIT_JOB_URL; |
70 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.SYSTEM_MONITORING_INFORMATION; |
71 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.THREAD_DUMP; |
72 |
| -import static org.apache.seatunnel.engine.server.rest.RestConstant.UPDATE_TAGS_URL; |
| 57 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_ENCRYPT_CONFIG; |
| 58 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_FINISHED_JOBS; |
| 59 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_GET_ALL_LOG_NAME; |
| 60 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_JOB_INFO; |
| 61 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_LOG; |
| 62 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_LOGS; |
| 63 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_METRICS; |
| 64 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_OPEN_METRICS; |
| 65 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_OVERVIEW; |
| 66 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_RUNNING_JOB; |
| 67 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_RUNNING_JOBS; |
| 68 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_RUNNING_THREADS; |
| 69 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_STOP_JOB; |
| 70 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_STOP_JOBS; |
| 71 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_SUBMIT_JOB; |
| 72 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_SUBMIT_JOBS; |
| 73 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_SYSTEM_MONITORING_INFORMATION; |
| 74 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_THREAD_DUMP; |
| 75 | +import static org.apache.seatunnel.engine.server.rest.RestConstant.REST_URL_UPDATE_TAGS; |
73 | 76 |
|
74 | 77 | /** The Jetty service for SeaTunnel engine server. */
|
75 | 78 | @Slf4j
|
@@ -134,26 +137,31 @@ public void createJettyServer() {
|
134 | 137 | new ServletHolder(new CurrentNodeLogServlet(nodeEngine));
|
135 | 138 | ServletHolder allLogNameServlet = new ServletHolder(new AllLogNameServlet(nodeEngine));
|
136 | 139 |
|
137 |
| - context.addServlet(overviewHolder, convertUrlToPath(OVERVIEW)); |
138 |
| - context.addServlet(runningJobsHolder, convertUrlToPath(RUNNING_JOBS_URL)); |
139 |
| - context.addServlet(finishedJobsHolder, convertUrlToPath(FINISHED_JOBS_INFO)); |
140 |
| - context.addServlet(systemMonitoringHolder, convertUrlToPath(SYSTEM_MONITORING_INFORMATION)); |
141 |
| - context.addServlet(jobInfoHolder, convertUrlToPath(JOB_INFO_URL)); |
142 |
| - context.addServlet(jobInfoHolder, convertUrlToPath(RUNNING_JOB_URL)); |
143 |
| - context.addServlet(threadDumpHolder, convertUrlToPath(THREAD_DUMP)); |
144 |
| - |
145 |
| - context.addServlet(submitJobHolder, convertUrlToPath(SUBMIT_JOB_URL)); |
146 |
| - context.addServlet(submitJobsHolder, convertUrlToPath(SUBMIT_JOBS_URL)); |
147 |
| - context.addServlet(stopJobHolder, convertUrlToPath(STOP_JOB_URL)); |
148 |
| - context.addServlet(stopJobsHolder, convertUrlToPath(STOP_JOBS_URL)); |
149 |
| - context.addServlet(encryptConfigHolder, convertUrlToPath(ENCRYPT_CONFIG)); |
150 |
| - context.addServlet(updateTagsHandler, convertUrlToPath(UPDATE_TAGS_URL)); |
151 |
| - |
152 |
| - context.addServlet(runningThreadsHolder, convertUrlToPath(RUNNING_THREADS)); |
153 |
| - |
154 |
| - context.addServlet(allNodeLogServletHolder, convertUrlToPath(GET_LOGS)); |
155 |
| - context.addServlet(currentNodeLogServlet, convertUrlToPath(GET_LOG)); |
156 |
| - context.addServlet(allLogNameServlet, convertUrlToPath(GET_ALL_LOG_NAME)); |
| 140 | + ServletHolder metricsServlet = new ServletHolder(new MetricsServlet(nodeEngine)); |
| 141 | + |
| 142 | + context.addServlet(overviewHolder, convertUrlToPath(REST_URL_OVERVIEW)); |
| 143 | + context.addServlet(runningJobsHolder, convertUrlToPath(REST_URL_RUNNING_JOBS)); |
| 144 | + context.addServlet(finishedJobsHolder, convertUrlToPath(REST_URL_FINISHED_JOBS)); |
| 145 | + context.addServlet( |
| 146 | + systemMonitoringHolder, convertUrlToPath(REST_URL_SYSTEM_MONITORING_INFORMATION)); |
| 147 | + context.addServlet(jobInfoHolder, convertUrlToPath(REST_URL_JOB_INFO)); |
| 148 | + context.addServlet(jobInfoHolder, convertUrlToPath(REST_URL_RUNNING_JOB)); |
| 149 | + context.addServlet(threadDumpHolder, convertUrlToPath(REST_URL_THREAD_DUMP)); |
| 150 | + |
| 151 | + context.addServlet(submitJobHolder, convertUrlToPath(REST_URL_SUBMIT_JOB)); |
| 152 | + context.addServlet(submitJobsHolder, convertUrlToPath(REST_URL_SUBMIT_JOBS)); |
| 153 | + context.addServlet(stopJobHolder, convertUrlToPath(REST_URL_STOP_JOB)); |
| 154 | + context.addServlet(stopJobsHolder, convertUrlToPath(REST_URL_STOP_JOBS)); |
| 155 | + context.addServlet(encryptConfigHolder, convertUrlToPath(REST_URL_ENCRYPT_CONFIG)); |
| 156 | + context.addServlet(updateTagsHandler, convertUrlToPath(REST_URL_UPDATE_TAGS)); |
| 157 | + |
| 158 | + context.addServlet(runningThreadsHolder, convertUrlToPath(REST_URL_RUNNING_THREADS)); |
| 159 | + |
| 160 | + context.addServlet(allNodeLogServletHolder, convertUrlToPath(REST_URL_LOGS)); |
| 161 | + context.addServlet(currentNodeLogServlet, convertUrlToPath(REST_URL_LOG)); |
| 162 | + context.addServlet(allLogNameServlet, convertUrlToPath(REST_URL_GET_ALL_LOG_NAME)); |
| 163 | + context.addServlet(metricsServlet, convertUrlToPath(REST_URL_METRICS)); |
| 164 | + context.addServlet(metricsServlet, convertUrlToPath(REST_URL_OPEN_METRICS)); |
157 | 165 |
|
158 | 166 | server.setHandler(context);
|
159 | 167 |
|
|
0 commit comments