yangjunhan commented on PR #19712:
URL: https://github.com/apache/flink/pull/19712#issuecomment-1136953209
Hi @Airblader. I understand the concerns from your perspectives. Let me
elaborate a bit more and talk about the main advantages it brings:
- This change helps to make each involved core module/component more
**standardized**, and can be customized via a common high-level configuration
abstraction.
- **Increase the potential reusability among the components**. Since the
core modules become more extensible and "modular", one can easily reuse and
integrate them for the future feature/page implementation if needed.
I'd like to answer your questions as well:
> who wants to modify this configuration and why?
People who are implementing a new feature in the future can save works from
implementing components of similar template views. For example, let's assume
implementing history server abilities just like the Spark does, it would help a
lot if we can reuse some of the existing components (subtasks, taskmanagers and
metrics, etc.).
> How would they be able to do so (how do you provide a custom component)?
There are only 2 steps to reuse a component with some customization. First,
define a module config factory:
```typescript
const OVERRIDE_JOB_OVERVIEW_MODULE_CONFIG_FACTORY = ():
JobOverviewModuleConfig => {
return {
// provide a custom action in the taskManager table
// MyCustomActionComponent and TaskManagerActionComponent share a common
abstraction
taskManagerActionComponent: MyCustomActionComponent
};
};
```
Then, provide this factory to the target module inside the `@NgModule`:
```typescript
providers: [
{
provide: JOB_OVERVIEW_MODULE_CONFIG,
useFactory: OVERRIDE_JOB_OVERVIEW_MODULE_CONFIG_FACTORY
},
...
]
```
After doing such, one can then reuse the
`JobOverviewDrawerTaskmanagersComponent` in a new module.
> How do we ensure that this doesn't break in the future?
As long as we do not overuse the configurability of components, the
complexity is manageable. Moreover, I can provide a README.md to throughly
describe how to develop a new configuration which allows others to follow in
the future.
> Where is all of this documented?
As mentioned above, I am happy to provide a guideline for this if needed.
Please do rethink about this proposal, thank you :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]