This is an automated email from the ASF dual-hosted git repository. mikexue pushed a commit to branch eventmesh-function in repository https://gitbox.apache.org/repos/asf/eventmesh.git
commit bcdef13b17ab75bcd8b6cb616a7ba548e8bda909 Author: xwm1992 <[email protected]> AuthorDate: Wed May 29 15:14:00 2024 +0800 fix missing apache header --- .../com/apache/eventmesh/admin/server/Admin.java | 21 ++++++++++ .../apache/eventmesh/admin/server/AdminServer.java | 22 +++++++++- .../admin/server/AdminServerProperties.java | 19 +++++++++ .../admin/server/AdminServerRuntimeException.java | 19 +++++++++ .../eventmesh/admin/server/ComponentLifeCycle.java | 19 +++++++++ .../eventmesh/admin/server/ExampleAdminServer.java | 20 +++++++++ .../admin/server/web/AdminGrpcServer.java | 33 ++++++++++++--- .../eventmesh/admin/server/web/BaseServer.java | 17 ++++++++ .../eventmesh/admin/server/web/GrpcServer.java | 17 ++++++++ .../eventmesh/admin/server/web/HttpServer.java | 17 ++++++++ .../apache/eventmesh/admin/server/web/Request.java | 17 ++++++++ .../eventmesh/admin/server/web/Response.java | 18 +++++++++ .../admin/server/web/ServerController.java | 18 +++++++++ .../admin/server/web/db/DBThreadPool.java | 30 ++++++++++++-- .../server/web/db/entity/EventMeshDataSource.java | 21 +++++++++- .../server/web/db/entity/EventMeshJobDetail.java | 19 +++++++++ .../server/web/db/entity/EventMeshJobInfo.java | 21 +++++++++- .../web/db/entity/EventMeshMysqlPosition.java | 21 +++++++++- .../entity/EventMeshPositionReporterHistory.java | 21 +++++++++- .../web/db/entity/EventMeshRuntimeHeartbeat.java | 21 +++++++++- .../web/db/entity/EventMeshRuntimeHistory.java | 21 +++++++++- .../web/db/mapper/EventMeshDataSourceMapper.java | 28 ++++++++++--- .../web/db/mapper/EventMeshJobInfoMapper.java | 28 ++++++++++--- .../db/mapper/EventMeshMysqlPositionMapper.java | 28 ++++++++++--- .../EventMeshPositionReporterHistoryMapper.java | 28 ++++++++++--- .../db/mapper/EventMeshRuntimeHeartbeatMapper.java | 28 ++++++++++--- .../db/mapper/EventMeshRuntimeHistoryMapper.java | 28 ++++++++++--- .../web/db/service/EventMeshDataSourceService.java | 17 ++++++++ .../web/db/service/EventMeshJobInfoService.java | 17 ++++++++ .../db/service/EventMeshMysqlPositionService.java | 17 ++++++++ .../EventMeshPositionReporterHistoryService.java | 17 ++++++++ .../service/EventMeshRuntimeHeartbeatService.java | 26 ++++++++++-- .../db/service/EventMeshRuntimeHistoryService.java | 25 ++++++++++-- .../impl/EventMeshDataSourceServiceImpl.java | 28 ++++++++++--- .../service/impl/EventMeshJobInfoServiceImpl.java | 30 +++++++++++--- .../impl/EventMeshMysqlPositionServiceImpl.java | 30 +++++++++++--- ...ventMeshPositionReporterHistoryServiceImpl.java | 28 ++++++++++--- .../impl/EventMeshRuntimeHeartbeatServiceImpl.java | 30 +++++++++++--- .../impl/EventMeshRuntimeHistoryServiceImpl.java | 28 ++++++++++--- .../server/web/handler/BaseRequestHandler.java | 18 +++++++++ .../server/web/handler/RequestHandlerFactory.java | 22 +++++++++- .../web/handler/impl/FetchJobRequestHandler.java | 23 ++++++++++- .../web/handler/impl/FetchPositionHandler.java | 21 ++++++++++ .../web/handler/impl/ReportHeartBeatHandler.java | 21 ++++++++++ .../web/handler/impl/ReportPositionHandler.java | 34 +++++++++++++--- .../EventMeshRuntimeHeartbeatBizService.java | 39 +++++++++++++----- .../service/job/EventMeshJobInfoBizService.java | 47 ++++++++++++++++------ .../position/EventMeshPositionBizService.java | 23 ++++++++++- .../service/position/IFetchPositionHandler.java | 18 +++++++++ .../service/position/IReportPositionHandler.java | 18 +++++++++ .../web/service/position/PositionHandler.java | 20 ++++++++- .../service/position/PositionHandlerFactory.java | 27 +++++++++++-- .../position/impl/MysqlPositionHandler.java | 37 +++++++++++++---- .../src/main/resources/META-INF/spring.factories | 17 ++++++++ .../src/main/resources/application.yaml | 17 ++++++++ .../src/main/resources/eventmesh-admin.properties | 17 ++++++++ 56 files changed, 1184 insertions(+), 128 deletions(-) diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/Admin.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/Admin.java index 9be047edc..fe3bfcbe1 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/Admin.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/Admin.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server; import org.apache.eventmesh.common.remote.Task; @@ -5,12 +22,16 @@ import org.apache.eventmesh.common.remote.request.ReportHeartBeatRequest; import org.apache.eventmesh.common.utils.PagedList; public interface Admin extends ComponentLifeCycle { + /** * support for web or ops **/ boolean createOrUpdateTask(Task task); + boolean deleteTask(Long id); + Task getTask(Long id); + // paged list PagedList<Task> getTaskPaged(Task task); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServer.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServer.java index a76b4c194..afd4d7707 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServer.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServer.java @@ -1,7 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server; import lombok.extern.slf4j.Slf4j; + import org.apache.commons.lang3.StringUtils; + import org.apache.eventmesh.common.Constants; import org.apache.eventmesh.common.config.CommonConfiguration; import org.apache.eventmesh.common.config.ConfigService; @@ -13,6 +32,7 @@ import org.apache.eventmesh.common.utils.PagedList; import org.apache.eventmesh.registry.RegisterServerInfo; import org.apache.eventmesh.registry.RegistryFactory; import org.apache.eventmesh.registry.RegistryService; + import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Service; @@ -31,7 +51,7 @@ public class AdminServer implements Admin, ApplicationListener<ApplicationReadyE public AdminServer(AdminServerProperties properties) { configuration = - ConfigService.getInstance().buildConfigInstance(CommonConfiguration.class); + ConfigService.getInstance().buildConfigInstance(CommonConfiguration.class); if (configuration == null) { throw new AdminServerRuntimeException(ErrorCode.STARTUP_CONFIG_MISS, "common configuration file miss"); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerProperties.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerProperties.java index ec507d599..affc0d928 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerProperties.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerProperties.java @@ -1,13 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server; import lombok.Getter; import lombok.Setter; + import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("event-mesh.admin-server") @Getter @Setter public class AdminServerProperties { + private int port; private boolean enableSSL; private String configurationPath; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerRuntimeException.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerRuntimeException.java index 0282bab39..1bf8d1f58 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerRuntimeException.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerRuntimeException.java @@ -1,10 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server; import lombok.Getter; public class AdminServerRuntimeException extends RuntimeException { + @Getter private final int code; + public AdminServerRuntimeException(int code, String message) { super(message); this.code = code; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ComponentLifeCycle.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ComponentLifeCycle.java index cc12f1afd..d467f5ac4 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ComponentLifeCycle.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ComponentLifeCycle.java @@ -1,6 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server; public interface ComponentLifeCycle { + void start() throws Exception; + void destroy(); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ExampleAdminServer.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ExampleAdminServer.java index 51e2e1038..c3b91a58e 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ExampleAdminServer.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ExampleAdminServer.java @@ -1,12 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server; import com.apache.eventmesh.admin.server.constatns.AdminServerConstants; + import org.apache.eventmesh.common.config.ConfigService; + import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ExampleAdminServer { + public static void main(String[] args) throws Exception { ConfigService.getInstance().setConfigPath(AdminServerConstants.EVENTMESH_CONF_HOME).setRootConfig(AdminServerConstants.EVENTMESH_CONF_FILE); SpringApplication.run(ExampleAdminServer.class); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/AdminGrpcServer.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/AdminGrpcServer.java index 751ffd85b..85ae9e733 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/AdminGrpcServer.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/AdminGrpcServer.java @@ -1,12 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; import com.apache.eventmesh.admin.server.AdminServerRuntimeException; import com.apache.eventmesh.admin.server.web.handler.BaseRequestHandler; import com.apache.eventmesh.admin.server.web.handler.RequestHandlerFactory; + import io.grpc.stub.ServerCallStreamObserver; import io.grpc.stub.StreamObserver; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.lang3.StringUtils; + import org.apache.eventmesh.common.protocol.grpc.adminserver.AdminServiceGrpc; import org.apache.eventmesh.common.protocol.grpc.adminserver.Payload; import org.apache.eventmesh.common.remote.exception.ErrorCode; @@ -15,26 +36,28 @@ import org.apache.eventmesh.common.remote.request.BaseRemoteRequest; import org.apache.eventmesh.common.remote.response.BaseRemoteResponse; import org.apache.eventmesh.common.remote.response.EmptyAckResponse; import org.apache.eventmesh.common.remote.response.FailResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service @Slf4j public class AdminGrpcServer extends AdminServiceGrpc.AdminServiceImplBase { + @Autowired RequestHandlerFactory handlerFactory; private Payload process(Payload value) { if (value == null || StringUtils.isBlank(value.getMetadata().getType())) { return PayloadUtil.from(FailResponse.build(ErrorCode.BAD_REQUEST, "bad request: type not " + - "exists")); + "exists")); } try { BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse> handler = - handlerFactory.getHandler(value.getMetadata().getType()); + handlerFactory.getHandler(value.getMetadata().getType()); if (handler == null) { return PayloadUtil.from(FailResponse.build(BaseRemoteResponse.UNKNOWN, - "not match any request handler")); + "not match any request handler")); } BaseRemoteResponse response = handler.handlerRequest((BaseRemoteRequest) PayloadUtil.parse(value), value.getMetadata()); if (response == null || response instanceof EmptyAckResponse) { @@ -44,8 +67,8 @@ public class AdminGrpcServer extends AdminServiceGrpc.AdminServiceImplBase { } catch (Exception e) { log.warn("process payload {} fail", value.getMetadata().getType(), e); if (e instanceof AdminServerRuntimeException) { - return PayloadUtil.from(FailResponse.build(((AdminServerRuntimeException)e).getCode(), - e.getMessage())); + return PayloadUtil.from(FailResponse.build(((AdminServerRuntimeException) e).getCode(), + e.getMessage())); } return PayloadUtil.from(FailResponse.build(ErrorCode.INTERNAL_ERR, "admin server internal err")); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/BaseServer.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/BaseServer.java index 764be8a9b..d93881e18 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/BaseServer.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/BaseServer.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; import com.apache.eventmesh.admin.server.ComponentLifeCycle; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/GrpcServer.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/GrpcServer.java index 1a1ccb17b..b1055f6ee 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/GrpcServer.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/GrpcServer.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; import com.apache.eventmesh.admin.server.AdminServerProperties; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/HttpServer.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/HttpServer.java index 681d613f3..9231fd937 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/HttpServer.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/HttpServer.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Request.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Request.java index d36c292d6..14be1b441 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Request.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Request.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; public class Request<T> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Response.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Response.java index 4502ad792..c244e8cf4 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Response.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Response.java @@ -1,6 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; public class Response<T> { + private boolean success; private String desc; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/ServerController.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/ServerController.java index 6f6e5fc7c..02b5a70c3 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/ServerController.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/ServerController.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web; import org.springframework.web.bind.annotation.RequestMapping; @@ -6,4 +23,5 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/eventmesh/admin") public class ServerController { + } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/DBThreadPool.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/DBThreadPool.java index e212dd2c5..e8b82a883 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/DBThreadPool.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/DBThreadPool.java @@ -1,10 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db; import lombok.extern.slf4j.Slf4j; + import org.apache.eventmesh.common.EventMeshThreadFactory; + import org.springframework.stereotype.Component; import javax.annotation.PreDestroy; + import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -12,11 +32,13 @@ import java.util.concurrent.TimeUnit; @Component @Slf4j public class DBThreadPool { + private final ThreadPoolExecutor executor = - new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors() * 2, - Runtime.getRuntime().availableProcessors() * 2, 0L, TimeUnit.SECONDS, - new LinkedBlockingQueue<>(1000), new EventMeshThreadFactory("admin-server-db"), - new ThreadPoolExecutor.DiscardOldestPolicy()); + new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors() * 2, + Runtime.getRuntime().availableProcessors() * 2, 0L, TimeUnit.SECONDS, + new LinkedBlockingQueue<>(1000), new EventMeshThreadFactory("admin-server-db"), + new ThreadPoolExecutor.DiscardOldestPolicy()); + @PreDestroy private void destroy() { if (!executor.isShutdown()) { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshDataSource.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshDataSource.java index 9df705048..292ec4e4f 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshDataSource.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshDataSource.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; import java.io.Serializable; @@ -11,9 +29,10 @@ import java.util.Date; /** * @TableName event_mesh_data_source */ -@TableName(value ="event_mesh_data_source") +@TableName(value = "event_mesh_data_source") @Data public class EventMeshDataSource implements Serializable { + @TableId(type = IdType.AUTO) private Integer id; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobDetail.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobDetail.java index 80174a239..803e89c32 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobDetail.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobDetail.java @@ -1,6 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import lombok.Data; + import org.apache.eventmesh.common.remote.JobState; import org.apache.eventmesh.common.remote.job.JobTransportType; import org.apache.eventmesh.common.remote.offset.RecordPosition; @@ -9,6 +27,7 @@ import java.util.Map; @Data public class EventMeshJobDetail { + private Integer id; private String name; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobInfo.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobInfo.java index efb3c95d0..cee300dd2 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobInfo.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshJobInfo.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; import java.io.Serializable; @@ -11,9 +29,10 @@ import java.util.Date; /** * @TableName event_mesh_job_info */ -@TableName(value ="event_mesh_job_info") +@TableName(value = "event_mesh_job_info") @Data public class EventMeshJobInfo implements Serializable { + @TableId(type = IdType.AUTO) private Integer jobID; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshMysqlPosition.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshMysqlPosition.java index 75a7c245e..991a12abb 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshMysqlPosition.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshMysqlPosition.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; import java.io.Serializable; @@ -11,9 +29,10 @@ import java.util.Date; /** * @TableName event_mesh_mysql_position */ -@TableName(value ="event_mesh_mysql_position") +@TableName(value = "event_mesh_mysql_position") @Data public class EventMeshMysqlPosition implements Serializable { + @TableId(type = IdType.AUTO) private Integer id; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshPositionReporterHistory.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshPositionReporterHistory.java index b1c51e7b4..555cb93df 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshPositionReporterHistory.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshPositionReporterHistory.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; import java.io.Serializable; @@ -11,9 +29,10 @@ import java.util.Date; /** * @TableName event_mesh_position_reporter_history */ -@TableName(value ="event_mesh_position_reporter_history") +@TableName(value = "event_mesh_position_reporter_history") @Data public class EventMeshPositionReporterHistory implements Serializable { + @TableId(type = IdType.AUTO) private Long id; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHeartbeat.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHeartbeat.java index 298a50173..011eb65af 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHeartbeat.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHeartbeat.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; import java.io.Serializable; @@ -11,9 +29,10 @@ import java.util.Date; /** * @TableName event_mesh_runtime_heartbeat */ -@TableName(value ="event_mesh_runtime_heartbeat") +@TableName(value = "event_mesh_runtime_heartbeat") @Data public class EventMeshRuntimeHeartbeat implements Serializable { + @TableId(type = IdType.AUTO) private Long id; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHistory.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHistory.java index 7d3e3f463..9f053b6f2 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHistory.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/entity/EventMeshRuntimeHistory.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; + import lombok.Data; import java.io.Serializable; @@ -11,9 +29,10 @@ import java.util.Date; /** * @TableName event_mesh_runtime_history */ -@TableName(value ="event_mesh_runtime_history") +@TableName(value = "event_mesh_runtime_history") @Data public class EventMeshRuntimeHistory implements Serializable { + @TableId(type = IdType.AUTO) private Long id; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshDataSourceMapper.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshDataSourceMapper.java index 805d3642a..8f4d8ddd6 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshDataSourceMapper.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshDataSourceMapper.java @@ -1,15 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.mapper; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource; import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Mapper; /** -* @author sodafang -* @description 针对表【event_mesh_data_source】的数据库操作Mapper -* @createDate 2024-05-09 15:52:49 -* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource -*/ + * @author sodafang + * @description 针对表【event_mesh_data_source】的数据库操作Mapper + * @createDate 2024-05-09 15:52:49 + * @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource + */ @Mapper public interface EventMeshDataSourceMapper extends BaseMapper<EventMeshDataSource> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshJobInfoMapper.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshJobInfoMapper.java index 0082a9f2e..ecac0cfbe 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshJobInfoMapper.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshJobInfoMapper.java @@ -1,15 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.mapper; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Mapper; /** -* @author sodafang -* @description 针对表【event_mesh_job_info】的数据库操作Mapper -* @createDate 2024-05-09 15:51:45 -* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo -*/ + * @author sodafang + * @description 针对表【event_mesh_job_info】的数据库操作Mapper + * @createDate 2024-05-09 15:51:45 + * @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo + */ @Mapper public interface EventMeshJobInfoMapper extends BaseMapper<EventMeshJobInfo> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshMysqlPositionMapper.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshMysqlPositionMapper.java index 1b29508c1..fcfd2297a 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshMysqlPositionMapper.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshMysqlPositionMapper.java @@ -1,15 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.mapper; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition; import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Mapper; /** -* @author sodafang -* @description 针对表【event_mesh_mysql_position】的数据库操作Mapper -* @createDate 2024-05-14 17:15:03 -* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition -*/ + * @author sodafang + * @description 针对表【event_mesh_mysql_position】的数据库操作Mapper + * @createDate 2024-05-14 17:15:03 + * @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition + */ @Mapper public interface EventMeshMysqlPositionMapper extends BaseMapper<EventMeshMysqlPosition> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshPositionReporterHistoryMapper.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshPositionReporterHistoryMapper.java index 2cdc59f71..a15237a61 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshPositionReporterHistoryMapper.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshPositionReporterHistoryMapper.java @@ -1,15 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.mapper; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Mapper; /** -* @author sodafang -* @description 针对表【event_mesh_position_reporter_history(记录position上报者变更时,老记录)】的数据库操作Mapper -* @createDate 2024-05-14 17:15:03 -* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory -*/ + * @author sodafang + * @description 针对表【event_mesh_position_reporter_history(记录position上报者变更时,老记录)】的数据库操作Mapper + * @createDate 2024-05-14 17:15:03 + * @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory + */ @Mapper public interface EventMeshPositionReporterHistoryMapper extends BaseMapper<EventMeshPositionReporterHistory> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHeartbeatMapper.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHeartbeatMapper.java index a23ef0422..24af0b9aa 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHeartbeatMapper.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHeartbeatMapper.java @@ -1,15 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.mapper; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat; import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Mapper; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Mapper -* @createDate 2024-05-14 17:15:03 -* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Mapper + * @createDate 2024-05-14 17:15:03 + * @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat + */ @Mapper public interface EventMeshRuntimeHeartbeatMapper extends BaseMapper<EventMeshRuntimeHeartbeat> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHistoryMapper.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHistoryMapper.java index 85fa51aec..957e5e7e1 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHistoryMapper.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/mapper/EventMeshRuntimeHistoryMapper.java @@ -1,15 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.mapper; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; + import org.apache.ibatis.annotations.Mapper; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Mapper -* @createDate 2024-05-14 17:15:03 -* @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Mapper + * @createDate 2024-05-14 17:15:03 + * @Entity com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory + */ @Mapper public interface EventMeshRuntimeHistoryMapper extends BaseMapper<EventMeshRuntimeHistory> { diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshDataSourceService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshDataSourceService.java index 6b1e2d8f7..fed9f17f0 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshDataSourceService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshDataSourceService.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshJobInfoService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshJobInfoService.java index c9a1e972a..5c70979f6 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshJobInfoService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshJobInfoService.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshMysqlPositionService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshMysqlPositionService.java index 83597b047..5985c3ce1 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshMysqlPositionService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshMysqlPositionService.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshPositionReporterHistoryService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshPositionReporterHistoryService.java index adaac4395..9b27130d5 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshPositionReporterHistoryService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshPositionReporterHistoryService.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHeartbeatService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHeartbeatService.java index 3b9b8465c..7d6c6c457 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHeartbeatService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHeartbeatService.java @@ -1,12 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat; import com.baomidou.mybatisplus.extension.service.IService; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Service -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Service + * @createDate 2024-05-14 17:15:03 + */ public interface EventMeshRuntimeHeartbeatService extends IService<EventMeshRuntimeHeartbeat> { + } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHistoryService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHistoryService.java index 0da277f26..d0dab8a7c 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHistoryService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/EventMeshRuntimeHistoryService.java @@ -1,13 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory; import com.baomidou.mybatisplus.extension.service.IService; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Service -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Service + * @createDate 2024-05-14 17:15:03 + */ public interface EventMeshRuntimeHistoryService extends IService<EventMeshRuntimeHistory> { } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshDataSourceServiceImpl.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshDataSourceServiceImpl.java index 0d9f4f296..b56be3a2b 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshDataSourceServiceImpl.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshDataSourceServiceImpl.java @@ -1,19 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshDataSource; import com.apache.eventmesh.admin.server.web.db.mapper.EventMeshDataSourceMapper; import com.apache.eventmesh.admin.server.web.db.service.EventMeshDataSourceService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_data_source】的数据库操作Service实现 -* @createDate 2024-05-09 15:52:49 -*/ + * @author sodafang + * @description 针对表【event_mesh_data_source】的数据库操作Service实现 + * @createDate 2024-05-09 15:52:49 + */ @Service public class EventMeshDataSourceServiceImpl extends ServiceImpl<EventMeshDataSourceMapper, EventMeshDataSource> - implements EventMeshDataSourceService{ + implements EventMeshDataSourceService { } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshJobInfoServiceImpl.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshJobInfoServiceImpl.java index eb2a6bf60..e4afe2da8 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshJobInfoServiceImpl.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshJobInfoServiceImpl.java @@ -1,21 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobInfo; import com.apache.eventmesh.admin.server.web.db.mapper.EventMeshJobInfoMapper; import com.apache.eventmesh.admin.server.web.db.service.EventMeshJobInfoService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import lombok.extern.slf4j.Slf4j; + import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_job_info】的数据库操作Service实现 -* @createDate 2024-05-09 15:51:45 -*/ + * @author sodafang + * @description 针对表【event_mesh_job_info】的数据库操作Service实现 + * @createDate 2024-05-09 15:51:45 + */ @Service @Slf4j public class EventMeshJobInfoServiceImpl extends ServiceImpl<EventMeshJobInfoMapper, EventMeshJobInfo> - implements EventMeshJobInfoService{ + implements EventMeshJobInfoService { + } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshMysqlPositionServiceImpl.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshMysqlPositionServiceImpl.java index a3bfa4770..e4c257c8b 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshMysqlPositionServiceImpl.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshMysqlPositionServiceImpl.java @@ -1,21 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition; import com.apache.eventmesh.admin.server.web.db.mapper.EventMeshMysqlPositionMapper; import com.apache.eventmesh.admin.server.web.db.service.EventMeshMysqlPositionService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import lombok.extern.slf4j.Slf4j; + import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_mysql_position】的数据库操作Service实现 -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_mysql_position】的数据库操作Service实现 + * @createDate 2024-05-14 17:15:03 + */ @Service @Slf4j public class EventMeshMysqlPositionServiceImpl extends ServiceImpl<EventMeshMysqlPositionMapper, EventMeshMysqlPosition> - implements EventMeshMysqlPositionService{ + implements EventMeshMysqlPositionService { + } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshPositionReporterHistoryServiceImpl.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshPositionReporterHistoryServiceImpl.java index 071d44f66..5fe66447b 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshPositionReporterHistoryServiceImpl.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshPositionReporterHistoryServiceImpl.java @@ -1,19 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshPositionReporterHistory; import com.apache.eventmesh.admin.server.web.db.mapper.EventMeshPositionReporterHistoryMapper; import com.apache.eventmesh.admin.server.web.db.service.EventMeshPositionReporterHistoryService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_position_reporter_history(记录position上报者变更时,老记录)】的数据库操作Service实现 -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_position_reporter_history(记录position上报者变更时,老记录)】的数据库操作Service实现 + * @createDate 2024-05-14 17:15:03 + */ @Service public class EventMeshPositionReporterHistoryServiceImpl extends ServiceImpl<EventMeshPositionReporterHistoryMapper, EventMeshPositionReporterHistory> - implements EventMeshPositionReporterHistoryService{ + implements EventMeshPositionReporterHistoryService { } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHeartbeatServiceImpl.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHeartbeatServiceImpl.java index 824bd3aec..1a1c4c1f1 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHeartbeatServiceImpl.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHeartbeatServiceImpl.java @@ -1,21 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat; import com.apache.eventmesh.admin.server.web.db.mapper.EventMeshRuntimeHeartbeatMapper; import com.apache.eventmesh.admin.server.web.db.service.EventMeshRuntimeHeartbeatService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import lombok.extern.slf4j.Slf4j; + import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Service实现 -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Service实现 + * @createDate 2024-05-14 17:15:03 + */ @Service @Slf4j public class EventMeshRuntimeHeartbeatServiceImpl extends ServiceImpl<EventMeshRuntimeHeartbeatMapper, EventMeshRuntimeHeartbeat> - implements EventMeshRuntimeHeartbeatService{ + implements EventMeshRuntimeHeartbeatService { + } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHistoryServiceImpl.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHistoryServiceImpl.java index c3883e55b..8d1c16973 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHistoryServiceImpl.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/db/service/impl/EventMeshRuntimeHistoryServiceImpl.java @@ -1,19 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.db.service.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory; import com.apache.eventmesh.admin.server.web.db.mapper.EventMeshRuntimeHistoryMapper; import com.apache.eventmesh.admin.server.web.db.service.EventMeshRuntimeHistoryService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Service实现 -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_history(记录runtime上运行任务的变更)】的数据库操作Service实现 + * @createDate 2024-05-14 17:15:03 + */ @Service public class EventMeshRuntimeHistoryServiceImpl extends ServiceImpl<EventMeshRuntimeHistoryMapper, EventMeshRuntimeHistory> - implements EventMeshRuntimeHistoryService{ + implements EventMeshRuntimeHistoryService { } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/BaseRequestHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/BaseRequestHandler.java index b1c9518c7..6e57b0c80 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/BaseRequestHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/BaseRequestHandler.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.handler; import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; @@ -5,6 +22,7 @@ import org.apache.eventmesh.common.remote.request.BaseRemoteRequest; import org.apache.eventmesh.common.remote.response.BaseRemoteResponse; public abstract class BaseRequestHandler<T extends BaseRemoteRequest, S extends BaseRemoteResponse> { + public BaseRemoteResponse handlerRequest(T request, Metadata metadata) { return handler(request, metadata); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/RequestHandlerFactory.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/RequestHandlerFactory.java index 33535e7f3..66dec6d5b 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/RequestHandlerFactory.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/RequestHandlerFactory.java @@ -1,7 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.handler; import org.apache.eventmesh.common.remote.request.BaseRemoteRequest; import org.apache.eventmesh.common.remote.response.BaseRemoteResponse; + import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; @@ -14,7 +32,7 @@ import java.util.concurrent.ConcurrentHashMap; public class RequestHandlerFactory implements ApplicationListener<ContextRefreshedEvent> { private final Map<String, BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse>> handlers = - new ConcurrentHashMap<>(); + new ConcurrentHashMap<>(); public BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse> getHandler(String type) { return handlers.get(type); @@ -24,7 +42,7 @@ public class RequestHandlerFactory implements ApplicationListener<ContextRefresh @SuppressWarnings({"rawtypes", "unchecked"}) public void onApplicationEvent(ContextRefreshedEvent event) { Map<String, BaseRequestHandler> beans = - event.getApplicationContext().getBeansOfType(BaseRequestHandler.class); + event.getApplicationContext().getBeansOfType(BaseRequestHandler.class); for (BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse> requestHandler : beans.values()) { Class<?> clazz = requestHandler.getClass(); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchJobRequestHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchJobRequestHandler.java index 9362581eb..7998869eb 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchJobRequestHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchJobRequestHandler.java @@ -1,15 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.handler.impl; import com.apache.eventmesh.admin.server.AdminServerRuntimeException; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshJobDetail; import com.apache.eventmesh.admin.server.web.handler.BaseRequestHandler; import com.apache.eventmesh.admin.server.web.service.job.EventMeshJobInfoBizService; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.lang3.StringUtils; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.exception.ErrorCode; import org.apache.eventmesh.common.remote.request.FetchJobRequest; import org.apache.eventmesh.common.remote.response.FetchJobResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -30,7 +51,7 @@ public class FetchJobRequestHandler extends BaseRequestHandler<FetchJobRequest, jobID = Integer.parseInt(request.getJobID()); } catch (NumberFormatException e) { throw new AdminServerRuntimeException(ErrorCode.BAD_REQUEST, String.format("illegal job id %s", - request.getJobID())); + request.getJobID())); } FetchJobResponse response = FetchJobResponse.successResponse(); EventMeshJobDetail detail = jobInfoBizService.getJobDetail(request, metadata); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchPositionHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchPositionHandler.java index bc5bc2050..46ce39cbd 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchPositionHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/FetchPositionHandler.java @@ -1,15 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.handler.impl; import com.apache.eventmesh.admin.server.AdminServerRuntimeException; import com.apache.eventmesh.admin.server.web.db.DBThreadPool; import com.apache.eventmesh.admin.server.web.handler.BaseRequestHandler; import com.apache.eventmesh.admin.server.web.service.position.EventMeshPositionBizService; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.lang3.StringUtils; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.exception.ErrorCode; import org.apache.eventmesh.common.remote.request.FetchPositionRequest; import org.apache.eventmesh.common.remote.response.FetchPositionResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportHeartBeatHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportHeartBeatHandler.java index 5011158f3..02c409c40 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportHeartBeatHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportHeartBeatHandler.java @@ -1,20 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.handler.impl; import com.apache.eventmesh.admin.server.web.db.DBThreadPool; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat; import com.apache.eventmesh.admin.server.web.handler.BaseRequestHandler; import com.apache.eventmesh.admin.server.web.service.heatbeat.EventMeshRuntimeHeartbeatBizService; + import lombok.extern.slf4j.Slf4j; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.request.ReportHeartBeatRequest; import org.apache.eventmesh.common.remote.response.EmptyAckResponse; import org.apache.eventmesh.common.utils.IPUtils; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component @Slf4j public class ReportHeartBeatHandler extends BaseRequestHandler<ReportHeartBeatRequest, EmptyAckResponse> { + @Autowired EventMeshRuntimeHeartbeatBizService heartbeatBizService; diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportPositionHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportPositionHandler.java index 168b4980b..d3b243419 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportPositionHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/handler/impl/ReportPositionHandler.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.handler.impl; import com.apache.eventmesh.admin.server.AdminServerRuntimeException; @@ -5,18 +22,23 @@ import com.apache.eventmesh.admin.server.web.db.DBThreadPool; import com.apache.eventmesh.admin.server.web.handler.BaseRequestHandler; import com.apache.eventmesh.admin.server.web.service.job.EventMeshJobInfoBizService; import com.apache.eventmesh.admin.server.web.service.position.EventMeshPositionBizService; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.lang3.StringUtils; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.exception.ErrorCode; import org.apache.eventmesh.common.remote.request.ReportPositionRequest; import org.apache.eventmesh.common.remote.response.EmptyAckResponse; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component @Slf4j public class ReportPositionHandler extends BaseRequestHandler<ReportPositionRequest, EmptyAckResponse> { + @Autowired EventMeshJobInfoBizService jobInfoBizService; @@ -44,7 +66,7 @@ public class ReportPositionHandler extends BaseRequestHandler<ReportPositionRequ jobID = Integer.parseInt(request.getJobID()); } catch (NumberFormatException e) { throw new AdminServerRuntimeException(ErrorCode.BAD_REQUEST, String.format("illegal job id [%s] format", - request.getJobID())); + request.getJobID())); } positionBizService.isValidatePositionRequest(request.getDataSourceType()); @@ -55,13 +77,13 @@ public class ReportPositionHandler extends BaseRequestHandler<ReportPositionRequ if (reported) { if (log.isDebugEnabled()) { log.debug("handle runtime [{}] report data type [{}] job [{}] position [{}] success", - request.getAddress(), request.getDataSourceType(), request.getJobID(), - request.getRecordPositionList()); + request.getAddress(), request.getDataSourceType(), request.getJobID(), + request.getRecordPositionList()); } } else { log.warn("handle runtime [{}] report data type [{}] job [{}] position [{}] fail", - request.getAddress(), request.getDataSourceType(), request.getJobID(), - request.getRecordPositionList()); + request.getAddress(), request.getDataSourceType(), request.getJobID(), + request.getRecordPositionList()); } } catch (Exception e) { log.warn("handle position request fail, request [{}]", request, e); @@ -72,7 +94,7 @@ public class ReportPositionHandler extends BaseRequestHandler<ReportPositionRequ } } catch (Exception e) { log.warn("update job id [{}] type [{}] state [{}] fail", request.getJobID(), - request.getDataSourceType(), request.getState(), e); + request.getDataSourceType(), request.getState(), e); } } }); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/heatbeat/EventMeshRuntimeHeartbeatBizService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/heatbeat/EventMeshRuntimeHeartbeatBizService.java index f5fd4ae8c..9cff31eb9 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/heatbeat/EventMeshRuntimeHeartbeatBizService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/heatbeat/EventMeshRuntimeHeartbeatBizService.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.heatbeat; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHeartbeat; @@ -5,15 +22,17 @@ import com.apache.eventmesh.admin.server.web.db.entity.EventMeshRuntimeHistory; import com.apache.eventmesh.admin.server.web.db.service.EventMeshRuntimeHeartbeatService; import com.apache.eventmesh.admin.server.web.db.service.EventMeshRuntimeHistoryService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; + import lombok.extern.slf4j.Slf4j; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** -* @author sodafang -* @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Service实现 -* @createDate 2024-05-14 17:15:03 -*/ + * @author sodafang + * @description 针对表【event_mesh_runtime_heartbeat】的数据库操作Service实现 + * @createDate 2024-05-14 17:15:03 + */ @Service @Slf4j public class EventMeshRuntimeHeartbeatBizService { @@ -26,19 +45,19 @@ public class EventMeshRuntimeHeartbeatBizService { public boolean saveOrUpdateByRuntimeAddress(EventMeshRuntimeHeartbeat entity) { EventMeshRuntimeHeartbeat old = heartbeatService.getOne(Wrappers.<EventMeshRuntimeHeartbeat>query().eq( - "runtimeAddr", - entity.getRuntimeAddr())); + "runtimeAddr", + entity.getRuntimeAddr())); if (old == null) { return heartbeatService.save(entity); } else { if (Long.parseLong(old.getReportTime()) >= Long.parseLong(entity.getReportTime())) { log.info("update heartbeat record ignore, current report time late than db, job " + - "[{}], remote [{}]", entity.getJobID(), entity.getRuntimeAddr()); + "[{}], remote [{}]", entity.getJobID(), entity.getRuntimeAddr()); return true; } try { return heartbeatService.update(entity, Wrappers.<EventMeshRuntimeHeartbeat>update().eq("updateTime", - old.getUpdateTime())); + old.getUpdateTime())); } finally { if (old.getJobID() != null && !old.getJobID().equals(entity.getJobID())) { EventMeshRuntimeHistory history = new EventMeshRuntimeHistory(); @@ -50,8 +69,8 @@ public class EventMeshRuntimeHeartbeatBizService { log.warn("save runtime job changed history fail", e); } - log.info("runtime [{}] changed job, old job [{}], now [{}]",entity.getRuntimeAddr(),old.getJobID(), - entity.getJobID()); + log.info("runtime [{}] changed job, old job [{}], now [{}]", entity.getRuntimeAddr(), old.getJobID(), + entity.getJobID()); } } } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/job/EventMeshJobInfoBizService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/job/EventMeshJobInfoBizService.java index 923dc086d..1c20f3565 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/job/EventMeshJobInfoBizService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/job/EventMeshJobInfoBizService.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.job; import com.apache.eventmesh.admin.server.AdminServerRuntimeException; @@ -9,8 +26,11 @@ import com.apache.eventmesh.admin.server.web.db.service.EventMeshJobInfoService; import com.apache.eventmesh.admin.server.web.service.position.EventMeshPositionBizService; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.fasterxml.jackson.core.type.TypeReference; + import lombok.extern.slf4j.Slf4j; + import org.apache.commons.lang3.StringUtils; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.JobState; import org.apache.eventmesh.common.remote.exception.ErrorCode; @@ -18,16 +38,17 @@ import org.apache.eventmesh.common.remote.job.DataSourceType; import org.apache.eventmesh.common.remote.job.JobTransportType; import org.apache.eventmesh.common.remote.request.FetchJobRequest; import org.apache.eventmesh.common.utils.JsonUtils; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Map; /** -* @author sodafang -* @description 针对表【event_mesh_job_info】的数据库操作Service实现 -* @createDate 2024-05-09 15:51:45 -*/ + * @author sodafang + * @description 针对表【event_mesh_job_info】的数据库操作Service实现 + * @createDate 2024-05-09 15:51:45 + */ @Service @Slf4j public class EventMeshJobInfoBizService { @@ -48,8 +69,8 @@ public class EventMeshJobInfoBizService { EventMeshJobInfo jobInfo = new EventMeshJobInfo(); jobInfo.setJobID(jobID); jobInfo.setState(state.ordinal()); - jobInfoService.update(jobInfo, Wrappers.<EventMeshJobInfo>update().notIn("state",JobState.DELETE.ordinal(), - JobState.COMPLETE.ordinal())); + jobInfoService.update(jobInfo, Wrappers.<EventMeshJobInfo>update().notIn("state", JobState.DELETE.ordinal(), + JobState.COMPLETE.ordinal())); return true; } @@ -70,16 +91,17 @@ public class EventMeshJobInfoBizService { if (!StringUtils.isBlank(source.getConfiguration())) { try { detail.setSourceConnectorConfig(JsonUtils.parseTypeReferenceObject(source.getConfiguration(), - new TypeReference<Map<String, Object>>() {})); + new TypeReference<Map<String, Object>>() { + })); } catch (Exception e) { log.warn("parse source config id [{}] fail", job.getSourceData(), e); - throw new AdminServerRuntimeException(ErrorCode.BAD_DB_DATA,"illegal source data source config"); + throw new AdminServerRuntimeException(ErrorCode.BAD_DB_DATA, "illegal source data source config"); } } detail.setSourceConnectorDesc(source.getDescription()); if (source.getDataType() != null) { detail.setPosition(positionBizService.getPositionByJobID(job.getJobID(), - DataSourceType.getDataSourceType(source.getDataType()))); + DataSourceType.getDataSourceType(source.getDataType()))); } } @@ -87,10 +109,11 @@ public class EventMeshJobInfoBizService { if (!StringUtils.isBlank(target.getConfiguration())) { try { detail.setSinkConnectorConfig(JsonUtils.parseTypeReferenceObject(target.getConfiguration(), - new TypeReference<Map<String, Object>>() {})); + new TypeReference<Map<String, Object>>() { + })); } catch (Exception e) { log.warn("parse sink config id [{}] fail", job.getSourceData(), e); - throw new AdminServerRuntimeException(ErrorCode.BAD_DB_DATA,"illegal target data sink config"); + throw new AdminServerRuntimeException(ErrorCode.BAD_DB_DATA, "illegal target data sink config"); } } detail.setSinkConnectorDesc(target.getDescription()); @@ -98,7 +121,7 @@ public class EventMeshJobInfoBizService { JobState state = JobState.fromIndex(job.getState()); if (state == null) { - throw new AdminServerRuntimeException(ErrorCode.BAD_DB_DATA,"illegal job state in db"); + throw new AdminServerRuntimeException(ErrorCode.BAD_DB_DATA, "illegal job state in db"); } detail.setState(state); detail.setTransportType(JobTransportType.getJobTransportType(job.getTransportType())); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/EventMeshPositionBizService.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/EventMeshPositionBizService.java index 03014389a..feaeb4ba9 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/EventMeshPositionBizService.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/EventMeshPositionBizService.java @@ -1,19 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.position; import com.apache.eventmesh.admin.server.AdminServerRuntimeException; + import lombok.extern.slf4j.Slf4j; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.exception.ErrorCode; import org.apache.eventmesh.common.remote.job.DataSourceType; import org.apache.eventmesh.common.remote.offset.RecordPosition; import org.apache.eventmesh.common.remote.request.FetchPositionRequest; import org.apache.eventmesh.common.remote.request.ReportPositionRequest; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service @Slf4j public class EventMeshPositionBizService { + @Autowired PositionHandlerFactory factory; @@ -34,7 +55,7 @@ public class EventMeshPositionBizService { IReportPositionHandler handler = factory.getHandler(type); if (handler == null) { throw new AdminServerRuntimeException(ErrorCode.BAD_REQUEST, String.format("illegal data base " + - "type [%s], it not match any report position handler", type)); + "type [%s], it not match any report position handler", type)); } } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IFetchPositionHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IFetchPositionHandler.java index 521f07d1b..a99b8c12d 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IFetchPositionHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IFetchPositionHandler.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.position; import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; @@ -5,5 +22,6 @@ import org.apache.eventmesh.common.remote.offset.RecordPosition; import org.apache.eventmesh.common.remote.request.FetchPositionRequest; public interface IFetchPositionHandler { + RecordPosition handler(FetchPositionRequest request, Metadata metadata); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IReportPositionHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IReportPositionHandler.java index 5c7d1ab41..31252573b 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IReportPositionHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/IReportPositionHandler.java @@ -1,8 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.position; import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.request.ReportPositionRequest; public interface IReportPositionHandler { + boolean handler(ReportPositionRequest request, Metadata metadata); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandler.java index d8ca71797..619f9d3f8 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandler.java @@ -1,7 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.position; import org.apache.eventmesh.common.remote.job.DataSourceType; -public abstract class PositionHandler implements IReportPositionHandler,IFetchPositionHandler { +public abstract class PositionHandler implements IReportPositionHandler, IFetchPositionHandler { + protected abstract DataSourceType getSourceType(); } diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandlerFactory.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandlerFactory.java index 6dedb1e3d..09218cfa2 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandlerFactory.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/PositionHandlerFactory.java @@ -1,7 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.position; import lombok.extern.slf4j.Slf4j; + import org.apache.eventmesh.common.remote.job.DataSourceType; + import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; @@ -12,8 +31,10 @@ import java.util.concurrent.ConcurrentHashMap; @Component @Slf4j public class PositionHandlerFactory implements ApplicationListener<ContextRefreshedEvent> { + private final Map<DataSourceType, PositionHandler> handlers = - new ConcurrentHashMap<>(); + new ConcurrentHashMap<>(); + public PositionHandler getHandler(DataSourceType type) { return handlers.get(type); } @@ -21,9 +42,9 @@ public class PositionHandlerFactory implements ApplicationListener<ContextRefres @Override public void onApplicationEvent(ContextRefreshedEvent event) { Map<String, PositionHandler> beans = - event.getApplicationContext().getBeansOfType(PositionHandler.class); + event.getApplicationContext().getBeansOfType(PositionHandler.class); - for (PositionHandler handler: beans.values()) { + for (PositionHandler handler : beans.values()) { DataSourceType type = handler.getSourceType(); if (handlers.containsKey(type)) { log.warn("data source type [{}] handler already exists", type); diff --git a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/impl/MysqlPositionHandler.java b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/impl/MysqlPositionHandler.java index f72b61f5d..d3c1bc9d0 100644 --- a/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/impl/MysqlPositionHandler.java +++ b/eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/service/position/impl/MysqlPositionHandler.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.apache.eventmesh.admin.server.web.service.position.impl; import com.apache.eventmesh.admin.server.web.db.entity.EventMeshMysqlPosition; @@ -6,7 +23,9 @@ import com.apache.eventmesh.admin.server.web.db.service.EventMeshMysqlPositionSe import com.apache.eventmesh.admin.server.web.db.service.EventMeshPositionReporterHistoryService; import com.apache.eventmesh.admin.server.web.service.position.PositionHandler; import com.baomidou.mybatisplus.core.toolkit.Wrappers; + import lombok.extern.slf4j.Slf4j; + import org.apache.eventmesh.common.protocol.grpc.adminserver.Metadata; import org.apache.eventmesh.common.remote.job.DataSourceType; import org.apache.eventmesh.common.remote.offset.RecordPosition; @@ -15,6 +34,7 @@ import org.apache.eventmesh.common.remote.offset.canal.CanalRecordPartition; import org.apache.eventmesh.common.remote.request.FetchPositionRequest; import org.apache.eventmesh.common.remote.request.ReportPositionRequest; import org.apache.eventmesh.common.utils.JsonUtils; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DuplicateKeyException; import org.springframework.stereotype.Component; @@ -24,6 +44,7 @@ import java.util.List; @Component @Slf4j public class MysqlPositionHandler extends PositionHandler { + @Autowired EventMeshMysqlPositionService positionService; @@ -37,20 +58,20 @@ public class MysqlPositionHandler extends PositionHandler { public boolean saveOrUpdateByJob(EventMeshMysqlPosition position) { EventMeshMysqlPosition old = positionService.getOne(Wrappers.<EventMeshMysqlPosition>query().eq("jobId", - position.getJobID())); + position.getJobID())); if (old == null) { return positionService.save(position); } else { if (old.getPosition() >= position.getPosition()) { log.info("job [{}] report position [{}] by runtime [{}] less than db position [{}] by [{}]", - position.getJobID(), position.getPosition(), position.getAddress(), old.getPosition(), old.getAddress()); + position.getJobID(), position.getPosition(), position.getAddress(), old.getPosition(), old.getAddress()); return true; } try { return positionService.update(position, Wrappers.<EventMeshMysqlPosition>update().eq("updateTime", - old.getUpdateTime())); + old.getUpdateTime())); } finally { - if (old.getAddress()!= null && !old.getAddress().equals(position.getAddress())) { + if (old.getAddress() != null && !old.getAddress().equals(position.getAddress())) { EventMeshPositionReporterHistory history = new EventMeshPositionReporterHistory(); history.setRecord(JsonUtils.toJSONString(position)); history.setJob(old.getJobID()); @@ -60,7 +81,7 @@ public class MysqlPositionHandler extends PositionHandler { historyService.save(history); } catch (Exception e) { log.warn("save job [{}] mysql position reporter changed history fail, now reporter [{}], old " + - "[{}]", position.getJobID(), position.getAddress(), old.getAddress(), e); + "[{}]", position.getJobID(), position.getAddress(), old.getAddress(), e); } } } @@ -79,12 +100,12 @@ public class MysqlPositionHandler extends PositionHandler { } if (!(recordPosition.getRecordPartition() instanceof CanalRecordPartition)) { log.warn("report mysql position, but record partition class [{}] not match [{}]", - recordPosition.getRecordPartition().getRecordPartitionClass(), CanalRecordPartition.class); + recordPosition.getRecordPartition().getRecordPartitionClass(), CanalRecordPartition.class); return false; } if (!(recordPosition.getRecordOffset() instanceof CanalRecordOffset)) { log.warn("report mysql position, but record offset class [{}] not match [{}]", - recordPosition.getRecordOffset().getRecordOffsetClass(), CanalRecordOffset.class); + recordPosition.getRecordOffset().getRecordOffsetClass(), CanalRecordOffset.class); return false; } CanalRecordOffset offset = (CanalRecordOffset) recordPosition.getRecordOffset(); @@ -123,7 +144,7 @@ public class MysqlPositionHandler extends PositionHandler { @Override public RecordPosition handler(FetchPositionRequest request, Metadata metadata) { EventMeshMysqlPosition position = positionService.getOne(Wrappers.<EventMeshMysqlPosition>query().eq("jobID" - , request.getJobID())); + , request.getJobID())); RecordPosition recordPosition = null; if (position != null) { CanalRecordPartition partition = new CanalRecordPartition(); diff --git a/eventmesh-admin-server/src/main/resources/META-INF/spring.factories b/eventmesh-admin-server/src/main/resources/META-INF/spring.factories index ced02f95f..e0bf3faae 100644 --- a/eventmesh-admin-server/src/main/resources/META-INF/spring.factories +++ b/eventmesh-admin-server/src/main/resources/META-INF/spring.factories @@ -1,2 +1,19 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.apache.eventmesh.admin.server.AdminServerProperties \ No newline at end of file diff --git a/eventmesh-admin-server/src/main/resources/application.yaml b/eventmesh-admin-server/src/main/resources/application.yaml index 397c3bb42..420a22fe6 100644 --- a/eventmesh-admin-server/src/main/resources/application.yaml +++ b/eventmesh-admin-server/src/main/resources/application.yaml @@ -1,3 +1,20 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + spring: datasource: url: jdbc:mysql://localhost:3306/eventmesh?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true diff --git a/eventmesh-admin-server/src/main/resources/eventmesh-admin.properties b/eventmesh-admin-server/src/main/resources/eventmesh-admin.properties index ceb1f59b3..07a6a212e 100644 --- a/eventmesh-admin-server/src/main/resources/eventmesh-admin.properties +++ b/eventmesh-admin-server/src/main/resources/eventmesh-admin.properties @@ -1,2 +1,19 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + eventMesh.server.retry.plugin.type=nacos eventMesh.registry.plugin.server-addr=localhost:8848 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
