Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #4781]management life cycle #4782

Closed
wants to merge 2 commits into from
Closed

[ISSUE #4781]management life cycle #4782

wants to merge 2 commits into from

Conversation

Ish1yu
Copy link
Contributor

@Ish1yu Ish1yu commented Mar 1, 2024

Fixes #4781

########
UnMergeable!!! its demo
########

Motivation

I found that Events have a large number of components that need to be collectively converted to a certain life cycle at a certain time,
Starting from the top level EventMeshServer, it needs to manage a series of internal related components, such as Acl MetaStorage, while its own life cycle changes, so I want to design an interface that allows these components to have the same method to be invoked at different times of life cycle states. In a way similar to the observer, I managed and bound components at the time of their own life cycle changes, so I implemented this PR, and now the implementation is the top-level, as well as the internal management of components, such as AclService inside the Acl is also a component, and there are a bunch of internal components
我发现Event有大量需要在某一特定时间共同转换到某一生命周期的组件,从最上层的 EventMeshServer 开始,他需要在自己生命周期变化的同时管理内部关联的一系列组件,如 Acl MetaStorage等,所以我想设计一个接口,让这些组件在不同的生命周期状态的时刻有同样的方法可以被调用,在通过类似观察者的方式,在自己生命周期变化的时刻管理和自己绑定的组件,所以我实现了这个PR,目前实现的是最顶层的,还有组件内部的管理,如 Acl 内部的 AclService也是一个组件,内部也有一堆组件,这个后续慢慢实现

Modifications

New org/apache/eventmesh/runtime/lifecircle EventMeshLifeCycle. Java is responsible for defining the eventmesh state transition method
New org/apache/eventmesh/runtime/lifecircle AbstractEventMeshComponent. Java implementation EventMeshLifeCycle define life cycle changes involved in the state and the binding of other components
New org/apache/eventmesh/runtime/lifecircle EventMeshComponent. Java eventmesh without switch control components, the implementation of state transition method, state huan rear method
New org/apache/eventmesh/runtime/lifecircle EventMeshSwitchableComponent. Java eventmesh with switch components, in EventMeshComponent increased switch function

Top-level component modification
EventMeshServer
-Acl Components with switches
-MetaStorage Components with switches
-Trace Components with switches
-StorageResource component
-ProducerTopicManager component
-EventMeshAdminBootstrap Component with a switch
-EventMeshGrpcBootstrap component

新增 org/apache/eventmesh/runtime/lifecircle/EventMeshLifeCycle.java 负责定义EventMesh中状态转换方法
新增 org/apache/eventmesh/runtime/lifecircle/AbstractEventMeshComponent.java 实现 EventMeshLifeCycle 定义生命周期变化中涉及的状态和绑定的其他组件
新增 org/apache/eventmesh/runtime/lifecircle/EventMeshComponent.java 没有开关控制的EventMesh组件,具体实现状态转换时的方法,状态装欢后置方法
新增 org/apache/eventmesh/runtime/lifecircle/EventMeshSwitchableComponent.java 带有开关的EventMesh组件,在EventMeshComponent增加了开关功能

顶层组件修改
EventMeshServer
-Acl 带有开关的组件
-MetaStorage 带有开关的组件
-Trace 带有开关的组件
-StorageResource 组件
-ProducerTopicManager 组件
-EventMeshAdminBootstrap 带有开关的组件
-EventMeshGrpcBootstrap 组件

Documentation

  • Does this pull request introduce a new feature? ( no)

@Pil0tXia
Copy link
Member

Pil0tXia commented Mar 2, 2024

plz check ci

@Ish1yu Ish1yu closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] EventMeshServer subcomponent lifecycle management
2 participants