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

[Improve][Manager] Refactor code in manager-service module #10484

Closed
2 tasks done
aloyszhang opened this issue Jun 21, 2024 · 0 comments · Fixed by #10485
Closed
2 tasks done

[Improve][Manager] Refactor code in manager-service module #10484

aloyszhang opened this issue Jun 21, 2024 · 0 comments · Fixed by #10485
Assignees
Milestone

Comments

@aloyszhang
Copy link
Contributor

aloyszhang commented Jun 21, 2024

Description

In manager-service module, there are many duplicated interfaces for API and open API.
e.g.
https://github.com/apache/inlong/blob/master/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java#L46~L62

/**
     * Save cluster tag.
     *
     * @param request cluster tag
     * @param operator name of operator
     * @return cluster tag id after saving
     */
    Integer saveTag(ClusterTagRequest request, String operator);

    /**
     * Save cluster tag.
     *
     * @param request cluster tag
     * @param opInfo userinfo of operator
     * @return cluster tag id after saving
     */
    Integer saveTag(ClusterTagRequest request, UserInfo opInfo);

The only difference is the last parameter, one is operator and the other is opInfo.
The opInfo is used to obtain the name operator, so we can say these two interfaces are the same.

There are some problems with this implementation:

  • code duplication, there are many redundant codes now
  • hard to maintain, we have to change both places when updating, if only change one interface, these two interfaces are out of consistency which we already have now

So, it's better to remove the duplicated code and keep consistency for InLong-API and InLong-OpenAPI.

InLong Component

InLong Manager

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant